The FML log should tell you why the model failed to load. If you don't know what to make of it, upload it to Gist/Pastebin and link it here.
You should be using ModelLoader.setCustomModelResourceLocation/setCustomMeshDefinition to register your models, not ItemModelMesher#register. Call these methods in ModelRegistryEvent (if you register your Items in RegistryEvent.Register<Item>, which you should do) or in preInit (if you register your Items in preInit).
Why are you removing your mod ID from the Item's registry name only to add it back again? Just use the registry name directly.
In future, please use Gist or Pastebin to post logs/crash reports (if applicable) and code with syntax highlighting. To get syntax highlighting on Gist, give each file the appropriate extension (.java for Java code). To get syntax highlighting on Pastebin, select the language from the dropdown at the bottom of the page.
It's much easier to read code with proper formatting and syntax highlighting.
Rollback Post to RevisionRollBack
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
I'm really just learning java. The tutorials I've seen haven't used the method you said. Could you link me to a good tutorial for 1.11.2? Or at least a guide ModelRegistryEvent. [/i]
You must have a solid understanding of Java before creating a mod. Most people on this forum won't help you if your problem is a lack of Java knowledge rather than a lack of Minecraft/Forge knowledge.
This page explains registries and RegistryEvent.Register. Like RegistryEvent.Register, ModelRegistryEvent is fired before preInit. Unlike RegistryEvent.Register, it must be handled in a client-only class that's only registered on the physical client. You can do this by passing Side.CLIENT to the @Mod.EventBusSubscriber annotation.
I don't know of any tutorials that use RegistryEvent.Register/ModelRegistryEvent.
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
I have no idea how to fix this. please help
public static final void registerRender(Item item) {
Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(item, 0,new ModelResourceLocation(ModInfo.MODID + ":" + item.getRegistryName().getResourcePath(), "inventory"));
}
this is what im using to render it
The FML log should tell you why the model failed to load. If you don't know what to make of it, upload it to Gist/Pastebin and link it here.
You should be using ModelLoader.setCustomModelResourceLocation/setCustomMeshDefinition to register your models, not ItemModelMesher#register. Call these methods in ModelRegistryEvent (if you register your Items in RegistryEvent.Register<Item>, which you should do) or in preInit (if you register your Items in preInit).
Why are you removing your mod ID from the Item's registry name only to add it back again? Just use the registry name directly.
In future, please use Gist or Pastebin to post logs/crash reports (if applicable) and code with syntax highlighting. To get syntax highlighting on Gist, give each file the appropriate extension (.java for Java code). To get syntax highlighting on Pastebin, select the language from the dropdown at the bottom of the page.
It's much easier to read code with proper formatting and syntax highlighting.
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
I'm really just learning java. The tutorials I've seen haven't used the method you said. Could you link me to a good tutorial for 1.11.2? Or at least a guide ModelRegistryEvent. [/i]
Thankyou for your time.
You must have a solid understanding of Java before creating a mod. Most people on this forum won't help you if your problem is a lack of Java knowledge rather than a lack of Minecraft/Forge knowledge.
This page explains registries and RegistryEvent.Register. Like RegistryEvent.Register, ModelRegistryEvent is fired before preInit. Unlike RegistryEvent.Register, it must be handled in a client-only class that's only registered on the physical client. You can do this by passing Side.CLIENT to the @Mod.EventBusSubscriber annotation.
I don't know of any tutorials that use RegistryEvent.Register/ModelRegistryEvent.
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
Thank you