User Tools

Site Tools


tutorial:blockappearance

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
tutorial:blockappearance [2021/06/21 13:55] – Write about newer MC versions redgrapefruittutorial:blockappearance [2022/01/30 02:43] – [Making a block transparent] solidblock
Line 7: Line 7:
 To fix this, you need to set your block's render layer to cutout or transparent. To fix this, you need to set your block's render layer to cutout or transparent.
  
-In a client-sided mod initializer, add:+In a [[documentation:entrypoint|client-sided mod initializer]], add:
 <code java> <code java>
 BlockRenderLayerMap.INSTANCE.putBlock(ExampleMod.MY_BLOCK, RenderLayer.getCutout()); BlockRenderLayerMap.INSTANCE.putBlock(ExampleMod.MY_BLOCK, RenderLayer.getCutout());
Line 27: Line 27:
 If you do not mark your block as non-opaque like this, then block faces behind the block will not render and you will be able to see through the world. If you do not mark your block as non-opaque like this, then block faces behind the block will not render and you will be able to see through the world.
  
 +Be sure to add your client entrypoint to fabric.mod.json.
 +You can do this like so:
 +<code json>
 +
 +  "entrypoints": {
 +    "main": [
 +      "mod.fabricmc.examplemod.ExampleMod"
 +    ],
 +    "client": [
 +      "mod.fabricmc.examplemod.ExampleModClient"
 +    ]
 +  },
 +</code>
 +
 +Note: For non-transparent blocks that are not full, you may have to ovverride the ''getOutlineShape'' method to return a non-full shape to avoid seeing through the world.
 ===== Making a block invisible ===== ===== Making a block invisible =====
 First we need to make the block appear invisible. First we need to make the block appear invisible.
tutorial/blockappearance.txt · Last modified: 2024/02/05 16:03 by haykam