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 [2019/08/28 21:49] – [Giving a block state] finish adding tutorial for blockstate jsons b0undarybreakertutorial:blockstate [2019/08/28 21:53] – add new section header for JSON stuff b0undarybreaker
Line 64: Line 64:
 } }
 </code> </code>
 +
 +==== Adding models for your blockstates ====
  
 You can also make the texture and model of your block change based on the state. This is done through a JSON file called a Blockstate JSON. All blocks need a blockstate JSON, whether they have multiple states or not, but the contents of the JSON can be as simple or complex as you like. Let's say you register an instance of ''MyBlock'' to the ID ''mymod:my_block''. Minecraft would look for a file at the location ''src/main/resources/assets/mymod/blockstates/my_block.json'' to load the state from. If you don't want your block to change models between states, the blockstate JSON can be very simple. It would look something like this: You can also make the texture and model of your block change based on the state. This is done through a JSON file called a Blockstate JSON. All blocks need a blockstate JSON, whether they have multiple states or not, but the contents of the JSON can be as simple or complex as you like. Let's say you register an instance of ''MyBlock'' to the ID ''mymod:my_block''. Minecraft would look for a file at the location ''src/main/resources/assets/mymod/blockstates/my_block.json'' to load the state from. If you don't want your block to change models between states, the blockstate JSON can be very simple. It would look something like this:
tutorial/blockstate.txt · Last modified: 2023/11/18 08:13 by solidblock