Posted October 6, 20159 yr I had this problem before but assumed it was just a problem with my coding so I restarted my project and it's still happening so I ask, why does a blocks texture while in the player's inventory use another blocks texture? The block that's using another blocks texture Registeration public static Block ChanceBlock; ChanceBlock = new ChanceBlock(Material.cloth); GameRegistry.registerBlock(ChanceBlock, "ChanceBlock"); registerRender(ChanceBlock); Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(item, 0, new ModelResourceLocation("avon:ChanceBlock", "inventory")); All the methods the above code are in is called in the init(). Blockstate.json { "variants": { "normal": { "model": "avon:ChanceBlock" } } } Blockmodel.json { "parent": "block/cube_all", "textures": { "all": "avon:blocks/ChanceBlock" } } Itemmodel.json { "parent": "avon:block/ChanceBlock", "display": { "thirdperson": { "rotation": [ 10, -45, 170 ], "translation": [ 0, 1.5, -2.75 ], "scale": [ 0.375, 0.375, 0.375 ] } } } The block that the texture is being taken from Registration public static BlockOre XeserOre; XeserOre = new XeserOre(Material.rock); GameRegistry.registerBlock(XeserOre, "XeserOre"); registerRender(XeserOre); Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(item, 0, new ModelResourceLocation("avon:XeserOre", "inventory")); Again, all called in init(); Blockstate.json { "variants": { "normal": { "model": "avon:XeserOre" } } } Blockmodel.json { "parent": "block/cube_all", "textures": { "all": "avon:blocks/XeserOre" } } Itemmodel.json { "parent": "avon:block/XeserOre", "display": { "thirdperson": { "rotation": [ 10, -45, 170 ], "translation": [ 0, 1.5, -2.75 ], "scale": [ 0.375, 0.375, 0.375 ] } } } If you need any more code to help me, I'd gladly get it to you as soon as I can. Thanks ~Macncheezy
October 17, 20159 yr What does your registerRender() Methode ? Sorry if there are mistakes in my english
October 17, 20159 yr Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(item, 0, new ModelResourceLocation("avon:ChanceBlock", "inventory")); I think you should be using the 'getItemFromBlock' method from the Item class as the first argument in the .register function. Maybe try Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(Item.getItemFromBlock(ChanceBlock), 0, new ModelResourceLocation("avon:ChanceBlock", "inventory")); Also, you should camelCase your variables instead of TitleCase. It's a little confusing to read.
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.