tutorial:blockappearance
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| tutorial:blockappearance [2025/06/10 16:40] – solidblock | tutorial:blockappearance [2026/03/05 19:25] (current) – Mojang mappings cassiancc | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | ~~REDIRECT> | ||
| ====== Manipulating a Block' | ====== Manipulating a Block' | ||
| Line 10: | Line 11: | ||
| //For version 1.21.5 and before:// | //For version 1.21.5 and before:// | ||
| < | < | ||
| - | @Environment(EnvType.CLIENT) | ||
| public class ExampleModClient implements ClientModInitializer { | public class ExampleModClient implements ClientModInitializer { | ||
| public void onInitializeClient() { | public void onInitializeClient() { | ||
| // To make some parts of the block transparent (like glass, saplings and doors): | // To make some parts of the block transparent (like glass, saplings and doors): | ||
| - | BlockRenderLayerMap.INSTANCE.putBlock(TutorialBlocks.MY_BLOCK, | + | BlockRenderLayerMap.INSTANCE.putBlock(TutorialBlocks.MY_BLOCK, |
| | | ||
| // To make some parts of the block translucent (like ice, stained glass and portal) | // To make some parts of the block translucent (like ice, stained glass and portal) | ||
| - | BlockRenderLayerMap.INSTANCE.putBlock(TutorialBlocks.MY_BLOCK, | + | BlockRenderLayerMap.INSTANCE.putBlock(TutorialBlocks.MY_BLOCK, |
| } | } | ||
| } | } | ||
| Line 24: | Line 24: | ||
| //For version 1.21.6 and after: // | //For version 1.21.6 and after: // | ||
| < | < | ||
| - | @Environment(EnvType.CLIENT) | ||
| public class ExampleModClient implements ClientModInitializer { | public class ExampleModClient implements ClientModInitializer { | ||
| public void onInitializeClient() { | public void onInitializeClient() { | ||
| // To make some parts of the block transparent (like glass, saplings and doors): | // To make some parts of the block transparent (like glass, saplings and doors): | ||
| - | BlockRenderLayerMap.putBlock(TutorialBlocks.MY_BLOCK, | + | BlockRenderLayerMap.putBlock(TutorialBlocks.MY_BLOCK, |
| | | ||
| // To make some parts of the block translucent (like ice, stained glass and portal) | // To make some parts of the block translucent (like ice, stained glass and portal) | ||
| - | BlockRenderLayerMap.putBlock(TutorialBlocks.MY_BLOCK, | + | BlockRenderLayerMap.putBlock(TutorialBlocks.MY_BLOCK, |
| } | } | ||
| } | } | ||
| </ | </ | ||
| - | You probably also want to make your block non-opaque. To do that, use the '' | + | You probably also want to make your block non-opaque. To do that, use the '' |
| < | < | ||
| - | | + | |
| </ | </ | ||
| Line 68: | Line 67: | ||
| < | < | ||
| @Override | @Override | ||
| - | public | + | public |
| - | return | + | return |
| } | } | ||
| </ | </ | ||
| Line 77: | Line 76: | ||
| < | < | ||
| @Override | @Override | ||
| - | public | + | public |
| - | | + | |
| } | } | ||
| </ | </ | ||
tutorial/blockappearance.1749573607.txt.gz · Last modified: 2025/06/10 16:40 by solidblock