User Tools

Site Tools


tutorial:blockstate

Differences

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

Link to this comparison view

Both sides previous revisionPrevious revision
Next revisionBoth sides next revision
tutorial:blockstate [2020/03/19 10:19] – don't hardcode a single Block instance in onUse juuztutorial:blockstate [2021/05/24 19:18] – [Adding models for your blockstates] Fix typo technici4n
Line 85: Line 85:
 - The ''"model"'' property is always passed an ID of a model. In this case, the game will look at the location ''src/main/resources/assets/mymod/models/block/my_block.json''. The ID here can be anything. It doesn't //need// to be the same as your block's ID, but if you only have one variant, it probably should. Block models have their own setup, which is documented very well on the Minecraft wiki page linked below. You can either write the JSON by hand or use a program like [[https://blockbench.net|Blockbench]] to generate it more easily. - The ''"model"'' property is always passed an ID of a model. In this case, the game will look at the location ''src/main/resources/assets/mymod/models/block/my_block.json''. The ID here can be anything. It doesn't //need// to be the same as your block's ID, but if you only have one variant, it probably should. Block models have their own setup, which is documented very well on the Minecraft wiki page linked below. You can either write the JSON by hand or use a program like [[https://blockbench.net|Blockbench]] to generate it more easily.
  
-If you //do// want to have different models for each blockstate, you'd want to add multiple variants. For the same ''src/main/resources/assets/mymod/blockstates/my_block.json'' location we used above, your could would probably look like such:+If you want to have different models for each blockstate, you should add multiple variants. For the same ''src/main/resources/assets/mymod/blockstates/my_block.json'' location we used above, your model file would probably look like such:
  
 <code JavaScript resources/assets/mymod/blockstates/my_block.json> <code JavaScript resources/assets/mymod/blockstates/my_block.json>
tutorial/blockstate.txt · Last modified: 2023/11/18 08:13 by solidblock