Started by
Dbok
on
Topic category: Help with Minecraft modding (Java Edition)
I'm making a block with a NBT Logic tag named "powered" (ISPOWERED in .java file) that is either true or false. (This part is working as it shows in the F3 menu.) When attaching that blockstate to the blockstate JSON file, it results in broken textures. How can I fix this?
This is the JSON code. Any help is appreciated!
{
"variants": {
"facing=north,powered=false": {
"model": "farmsandfood:block/redstone_burner"
},
"facing=east,powered=false": {
"model": "farmsandfood:block/redstone_burner",
"y": 90
},
"facing=south,powered=false": {
"model": "farmsandfood:block/redstone_burner",
"y": 180
},
"facing=west,powered=false": {
"model": "farmsandfood:block/redstone_burner",
"y": 270
},
"facing=north,powered=true": {
"model": "farmsandfood:block/redstone_burner_lit"
},
"facing=east,powered=true": {
"model": "farmsandfood:block/redstone_burner_lit",
"y": 90
},
"facing=south,powered=true": {
"model": "farmsandfood:block/redstone_burner_lit",
"y": 180
},
"facing=west,powered=true": {
"model": "farmsandfood:block/redstone_burner_lit",
"y": 270
}
}
}
The issue with using a custom blockstate is that you have to define it in your block's code, which means you will have to lock the code. Here's an example code from my current mod I'm working on: https://imgur.com/NahWb1a
There are two crucial parts, the first being defining the blockstate/property:
And then you have to tell the game what the default is: