Render Block Basic-1.8.9
From McJty Modding
Rendering a basic block is very similar to a basic item except that you need two json files now. One for the blockstates:
public class SimpleTexturedBlock extends Block {
public SimpleTexturedBlock() {
super(Material.rock);
setUnlocalizedName("simpletexturedblock");
setRegistryName("simpletexturedblock");
GameRegistry.registerBlock(this);
}
@SideOnly(Side.CLIENT)
public void initModel() {
ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(this), 0, new ModelResourceLocation(getRegistryName(), "inventory"));
}
}
Now the blockstate json (resources/assets/firstmod/blockstates/simpletexturedblock.json): (Please note that "simplytexturedblock.json" is the exact same name as the name set in your unlocalizedName and RegistryName above!)
{ "forge_marker": 1, "defaults": { "model": "modtut:simpletexturedblock" }, "variants": { "normal": [{}], "inventory": [{}] } }
The model itself (resources/assets/firstmod/models/block/simpletexturedblock.json): (Please note that "simplytexturedblock.json" is the exact same name as the name set in your unlocalizedName and RegistryName above!)
{ "parent": "block/cube_all", "textures": { "all": "modtut:blocks/blocktexture" } }
Then don't forget to add a blocktexture.png texture in assets/firstmod/textures/blocks