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 revision Previous revision
tutorial:blockstate [2019/08/28 21:54]
b0undarybreaker [Adding models for your blockstates]
tutorial:blockstate [2019/08/29 07:47] (current)
jamieswhiteshirt [Adding models for your blockstates] JavaScript formatting, add file names
Line 71: Line 71:
 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: 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:
  
-<code json>+<​code ​JavaScript resources/​assets/​mymod/​blockstates/​my_block.json>
 { {
     "​variants":​ {     "​variants":​ {
Line 88: Line 88:
 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 //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:
  
-<code json>+<​code ​JavaScript resources/​assets/​mymod/​blockstates/​my_block.json>
 { {
     "​variants":​ {     "​variants":​ {
tutorial/blockstate.txt ยท Last modified: 2019/08/29 07:47 by jamieswhiteshirt