public void registerItemModels(ModelRegistryEvent e) {
for(Item item : Main.itemList){
ModelLoader.setCustomModelResourceLocation(item,0, new ModelResourceLocation(Main._MODID+":"+item.getRegistryName(),"inventory"));
}
debug.logs about the blockstate file:
[00:41:16] [main/ERROR] [FML]: Exception loading model for variant toybox:toybox:explmine#inventory, blockstate location exception:
net.minecraftforge.client.model.ModelLoaderRegistry$LoaderException: Exception loading model toybox:toybox:explmine#inventory with loader VariantLoader.INSTANCE, skipping
at net.minecraftforge.client.model.ModelLoaderRegistry.getModel(ModelLoaderRegistry.java:161) ~[ModelLoaderRegistry.class:?]
at net.minecraftforge.client.model.ModelLoader.func_177590_d(ModelLoader.java:296) ~[ModelLoader.class:?]
at net.minecraft.client.renderer.block.model.ModelBakery.func_177577_b(ModelBakery.java:194) ~[cgb.class:?]
at net.minecraftforge.client.model.ModelLoader.func_177570_a(ModelLoader.java:151) ~[ModelLoader.class:?]
at net.minecraft.client.renderer.block.model.ModelManager.func_110549_a(ModelManager.java:28) [cgc.class:?]
at net.minecraft.client.resources.SimpleReloadableResourceManager.func_110542_a(SimpleReloadableResourceManager.java:121) [cev.class:?]
at net.minecraft.client.Minecraft.func_71384_a(Minecraft.java:512) [bib.class:?]
at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:377) [bib.class:?]
at net.minecraft.client.main.Main.main(SourceFile:123) [Main.class:?]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_191]
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_191]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_191]
at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_191]
at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) [launchwrapper-1.12.jar:?]
at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.12.jar:?]
Caused by: net.minecraft.client.renderer.block.model.ModelBlockDefinition$MissingVariantException
at net.minecraft.client.renderer.block.model.ModelBlockDefinition.func_188004_c(ModelBlockDefinition.java:83) ~[bvv.class:?]
at net.minecraftforge.client.model.ModelLoader$VariantLoader.loadModel(ModelLoader.java:1175) ~[ModelLoader$VariantLoader.class:?]
at net.minecraftforge.client.model.ModelLoaderRegistry.getModel(ModelLoaderRegistry.java:157) ~[ModelLoaderRegistry.class:?]
... 14 more
I know i'm missing something stupidly obvious, but after encountering several variants of blockstate files it's hard to tell what's the right way of writing them.
I believe this is your issue: Main._MODID+":"+item.getRegistryName() in registerItemModels.
getRegistryName also returns the domain as part of the string, so this line becomes "toybox:toybox:explmin". You've doubled up the domains. You can also see this in the screenshot, the resource thinks it belongs to "toybox:toybox:explmine#inventory". Remove The unnecessary "Main._MODID + ":" from your modelResourceLocation and you should be golden.
Screenshots:
Mod structure:
Blockstate file:
Model file (models/blocks):
Model file(models/items):
registerItemModels method (ClientProxy.java):
debug.logs about the blockstate file:
I know i'm missing something stupidly obvious, but after encountering several variants of blockstate files it's hard to tell what's the right way of writing them.
Bump
Bump...
Any help? Please?
I believe this is your issue: Main._MODID+":"+item.getRegistryName() in registerItemModels.
getRegistryName also returns the domain as part of the string, so this line becomes "toybox:toybox:explmin". You've doubled up the domains. You can also see this in the screenshot, the resource thinks it belongs to "toybox:toybox:explmine#inventory". Remove The unnecessary "Main._MODID + ":" from your modelResourceLocation and you should be golden.
Check out my Youtube channel, where I build a theme park in vanilla Minecraft!
https://www.youtube.com/playlist?list=PLeCiIIOoWhe-mq3nYd_nXXrKw9MkjnUU7
Yep, I'm dumb.
/thread