Forge: 1.18.2-40.1.0
Parchment: 2022.06.19-1.18.2
I'm searching for a Wall blockstate.json example as I'm not finding any on the minecraft (external libreries) folder. I'm doing a custom wall for a new material, nothing fancy as I just want the normal behavior. This are the details of my implementation.
Registering the Block and WallBlock
public static final RegistryObject<Block> EXPERIMENTAL_STONE = registerBlock("experimental_stone", () -> new Block(BlockBehaviour.Properties.of(Material.STONE).strength(9f).requiresCorrectToolForDrops()), ExperimentalCreativeModeTab.EXPERIMENTAL_TAB);
public static final RegistryObject<WallBlock> EXPERIMENTAL_STONE_WALL = registerBlock("experimental_stone_wall", () -> new WallBlock(BlockBehaviour.Properties.copy(EXPERIMENTAL_STONE.get())), ExperimentalCreativeModeTab.EXPERIMENTAL_TAB);
private static <T extends Block> RegistryObject<T> registerBlock(String name, Supplier<T> block, CreativeModeTab tab){
RegistryObject<T> toReturn = BLOCKS.register(name, block);
registerBlockItem(name, toReturn, tab);
return toReturn;
}
private static <T extends Block> RegistryObject<Item> registerBlockItem(String name, RegistryObject<T> block, CreativeModeTab tab){
return ExperimentalItems.ITEMS.register(name, () -> new BlockItem(block.get(), new Item.Properties().tab(tab)));
}
Current blockstate implementation:
assets/experimental/blockstates/experimental_stone.json
{
"variants": {
"": {
"model": "experimental:block/experimental_stone"
}
}
}
assets/experimental/blockstates/experimental_stone_wall.json
{
"multipart": [
{ "when": { "up": "true" },
"apply": { "model": "experimental:block/experimental_stone_wall_post", "uvlock": true }
},
{ "when": { "north": "low" },
"apply": { "model": "experimental:block/experimental_stone_wall_side", "uvlock": true }
},
{ "when": { "east": "low" },
"apply": { "model": "experimental:block/experimental_stone_wall_side", "y": 90, "uvlock": true }
},
{ "when": { "south": "low" },
"apply": { "model": "experimental:block/experimental_stone_wall_side", "y": 180, "uvlock": true }
},
{ "when": { "west": "low" },
"apply": { "model": "experimental:block/experimental_stone_wall_side", "y": 270, "uvlock": true }
},
{ "when": { "north": "tall" },
"apply": { "model": "experimental:block/experimental_stone_wall_post", "uvlock": true }
},
{ "when": { "east": "tall" },
"apply": { "model": "experimental:block/experimental_stone_wall_post", "y": 90, "uvlock": true }
},
{ "when": { "south": "tall" },
"apply": { "model": "experimental:block/experimental_stone_wall_post", "y": 180, "uvlock": true }
},
{ "when": { "west": "tall" },
"apply": { "model": "experimental:block/experimental_stone_wall_post", "y": 270, "uvlock": true }
}
]
}
With this, I don't se any error on logs, or any missing texture, and the wall block is attaching with anything that is not itself, but it would seem I'm missing a property for being able to attach to itself.
I do find a declaration on the vanilla BlockStateData class with this:
register(2224, "{Name:'minecraft:cobblestone_wall',Properties:{east:'false',north:'false',south:'false',up:'false',west:'false'}}", "{Name:'minecraft:cobblestone_wall',Properties:{east:'false',north:'false',south:'false',up:'false',variant:'cobblestone',west:'false'}}", "{Name:'minecraft:cobblestone_wall',Properties:{east:'false',north:'false',south:'false',up:'false',variant:'cobblestone',west:'true'}}", "{Name:'minecraft:cobblestone_wall',Properties:{east:'false',north:'false',south:'false',up:'true',variant:'cobblestone',west:'false'}}", "{Name:'minecraft:cobblestone_wall',Properties:{east:'false',north:'false',south:'false',up:'true',variant:'cobblestone',west:'true'}}", "{Name:'minecraft:cobblestone_wall',Properties:{east:'false',north:'false',south:'true',up:'false',variant:'cobblestone',west:'false'}}", "{Name:'minecraft:cobblestone_wall',Properties:{east:'false',north:'false',south:'true',up:'false',variant:'cobblestone',west:'true'}}", "{Name:'minecraft:cobblestone_wall',Properties:{east:'false',north:'false',south:'true',up:'true',variant:'cobblestone',west:'false'}}", "{Name:'minecraft:cobblestone_wall',Properties:{east:'false',north:'false',south:'true',up:'true',variant:'cobblestone',west:'true'}}", "{Name:'minecraft:cobblestone_wall',Properties:{east:'false',north:'true',south:'false',up:'false',variant:'cobblestone',west:'false'}}", "{Name:'minecraft:cobblestone_wall',Properties:{east:'false',north:'true',south:'false',up:'false',variant:'cobblestone',west:'true'}}", "{Name:'minecraft:cobblestone_wall',Properties:{east:'false',north:'true',south:'false',up:'true',variant:'cobblestone',west:'false'}}", "{Name:'minecraft:cobblestone_wall',Properties:{east:'false',north:'true',south:'false',up:'true',variant:'cobblestone',west:'true'}}", "{Name:'minecraft:cobblestone_wall',Properties:{east:'false',north:'true',south:'true',up:'false',variant:'cobblestone',west:'false'}}", "{Name:'minecraft:cobblestone_wall',Properties:{east:'false',north:'true',south:'true',up:'false',variant:'cobblestone',west:'true'}}", "{Name:'minecraft:cobblestone_wall',Properties:{east:'false',north:'true',south:'true',up:'true',variant:'cobblestone',west:'false'}}", "{Name:'minecraft:cobblestone_wall',Properties:{east:'false',north:'true',south:'true',up:'true',variant:'cobblestone',west:'true'}}", "{Name:'minecraft:cobblestone_wall',Properties:{east:'true',north:'false',south:'false',up:'false',variant:'cobblestone',west:'false'}}", "{Name:'minecraft:cobblestone_wall',Properties:{east:'true',north:'false',south:'false',up:'false',variant:'cobblestone',west:'true'}}", "{Name:'minecraft:cobblestone_wall',Properties:{east:'true',north:'false',south:'false',up:'true',variant:'cobblestone',west:'false'}}", "{Name:'minecraft:cobblestone_wall',Properties:{east:'true',north:'false',south:'false',up:'true',variant:'cobblestone',west:'true'}}", "{Name:'minecraft:cobblestone_wall',Properties:{east:'true',north:'false',south:'true',up:'false',variant:'cobblestone',west:'false'}}", "{Name:'minecraft:cobblestone_wall',Properties:{east:'true',north:'false',south:'true',up:'false',variant:'cobblestone',west:'true'}}", "{Name:'minecraft:cobblestone_wall',Properties:{east:'true',north:'false',south:'true',up:'true',variant:'cobblestone',west:'false'}}", "{Name:'minecraft:cobblestone_wall',Properties:{east:'true',north:'false',south:'true',up:'true',variant:'cobblestone',west:'true'}}", "{Name:'minecraft:cobblestone_wall',Properties:{east:'true',north:'true',south:'false',up:'false',variant:'cobblestone',west:'false'}}", "{Name:'minecraft:cobblestone_wall',Properties:{east:'true',north:'true',south:'false',up:'false',variant:'cobblestone',west:'true'}}", "{Name:'minecraft:cobblestone_wall',Properties:{east:'true',north:'true',south:'false',up:'true',variant:'cobblestone',west:'false'}}", "{Name:'minecraft:cobblestone_wall',Properties:{east:'true',north:'true',south:'false',up:'true',variant:'cobblestone',west:'true'}}", "{Name:'minecraft:cobblestone_wall',Properties:{east:'true',north:'true',south:'true',up:'false',variant:'cobblestone',west:'false'}}", "{Name:'minecraft:cobblestone_wall',Properties:{east:'true',north:'true',south:'true',up:'false',variant:'cobblestone',west:'true'}}", "{Name:'minecraft:cobblestone_wall',Properties:{east:'true',north:'true',south:'true',up:'true',variant:'cobblestone',west:'false'}}", "{Name:'minecraft:cobblestone_wall',Properties:{east:'true',north:'true',south:'true',up:'true',variant:'cobblestone',west:'true'}}");
But when I try something similar to "north": true, it does generate an error and textures for the wall are not generated.:
←[mjava.lang.RuntimeException: Unknown value 'true' for property 'north' on 'Block{experimental:experimental_stone_wall}' in 'true'
........ (removed the whole stacktrace as it ends here with the detail)
at
[email protected]/cpw.mods.bootstraplauncher.BootstrapLauncher.main(BootstrapLauncher.java:149)
←[33m[18:26:53] [Render thread/WARN] [minecraft/ModelBakery]: Unable to bake model: 'experimental:experimental_stone_wall#east=low,north=tall,south=none,up=true,waterlogged=false,west=none': java.lang.RuntimeException: Unknown value 'true' for property 'north' on 'Block{experimental:experimental_stone_wall}' in 'true'
Thanks in advance for the help!