Posted August 17, 20178 yr I am trying to code my first mod and everything is working but i can't get the game to register my item. Here is the code plz Help. package AlphaPlayz.Lava.init; import AlphaPlayz.Lava.Reference; import AlphaPlayz.Lava.items.ItemCheese; import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.block.model.ModelResourceLocation; import net.minecraft.item.Item; import net.minecraftforge.fml.common.registry.GameRegistry; public class ModItems { public static Item cheese; public static void init(){ cheese = new ItemCheese(); } public static void register() { ForgeRegistry.ITEMS.register(cheese); } public static void registerRenders(){ registerRender(cheese); } private static void registerRender(Item item){ Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(item, 0, new ModelResourceLocation(Reference.MOD_ID + ":" + item.getUnlocalizedName().substring(5), "inventory")); } }
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.