Posted November 1, 20159 yr I can't figure out for the life of me why this isn't working as it was working fine a few months ago, but whenever I try to render a simple item I get the error "Model definition for location x#inventory not found" Here's the class registering it package com.bryceclark56.horticulture.Item; import com.bryceclark56.horticulture.Reference.Reference; import net.minecraft.client.Minecraft; import net.minecraft.client.resources.model.ModelBakery; import net.minecraft.client.resources.model.ModelResourceLocation; import net.minecraft.item.Item; import net.minecraftforge.fml.common.registry.GameRegistry; public class Items { public static final FoodHorticulture lettuce = new FoodHorticulture(6, 2, false).setUnlocalizedName("lettuce"); public static void registerRenderer(Item item, String name) { ModelBakery.addVariantName(item, Reference.MOD_ID + ":" + name); Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(item, 0, new ModelResourceLocation(Reference.MOD_ID + ":" + name, "inventory")); } public static void init() { GameRegistry.registerItem(lettuce, "lettuce"); } public static void registerModels() { registerRenderer(lettuce, "lettuce"); } } And the JSON file. { "parent": "builtin/generated", "textures": { "layer0": "horticulture:items/lettuce" }, "display": { "thirdperson": { "rotation": [ -90, 0, 0 ], "translation": [ 0, 1, -3 ], "scale": [ 0.55, 0.55, 0.55 ] }, "firstperson": { "rotation": [ 0, -135, 25 ], "translation": [ 0, 4, 2 ], "scale": [ 1.7, 1.7, 1.7 ] } } } Also worth noting that the renderer is only being registered on the client proxy so that's not the problem.
November 1, 20159 yr I'm pretty sure you are supposed to add variants after the original register. Try swapping those lines.
November 1, 20159 yr Author I did have it registered in preinit then the model thing in init, I ended up fixing it though I don't exactly know how... I just started over and it ended up working.
November 1, 20159 yr I think you have to do the model bakery in the preInit part of the Client Proxy (if existing) and then ModelMesher part in the init method of the Client Proxy.
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.