Jump to content

Item models don't render


shane020482

Recommended Posts

I know this is a older topic but Iv ran into a small prob. When using custom models the default model method doesent work and the item blocks dont render. If I put the model in each of the variants the blocks look fine but nothing I do makes the item render. I have used this method for other blocks that use the MC cube model and it works fine its just when I use a custom model.

 

Item error

 

[08:34:54] [Client thread/ERROR] [FML]: Exception loading model for variant deadlyworld:block_lamp#ison=true,type=black for blockstate "deadlyworld:block_lamp[ison=true,type=black]"

net.minecraftforge.client.model.ModelLoaderRegistry$LoaderException: Exception loading model deadlyworld:block_lamp#ison=true,type=black with loader VariantLoader.INSTANCE, skipping

at net.minecraftforge.client.model.ModelLoaderRegistry.getModel(ModelLoaderRegistry.java:153) ~[ModelLoaderRegistry.class:?]

at net.minecraftforge.client.model.ModelLoader.registerVariant(ModelLoader.java:241) ~[ModelLoader.class:?]

at net.minecraft.client.renderer.block.model.ModelBakery.loadBlock(ModelBakery.java:145) ~[ModelBakery.class:?]

at net.minecraftforge.client.model.ModelLoader.loadBlocks(ModelLoader.java:229) ~[ModelLoader.class:?]

at net.minecraftforge.client.model.ModelLoader.setupModelRegistry(ModelLoader.java:146) ~[ModelLoader.class:?]

at net.minecraft.client.renderer.block.model.ModelManager.onResourceManagerReload(ModelManager.java:28) [ModelManager.class:?]

at net.minecraft.client.resources.SimpleReloadableResourceManager.notifyReloadListeners(SimpleReloadableResourceManager.java:132) [simpleReloadableResourceManager.class:?]

at net.minecraft.client.resources.SimpleReloadableResourceManager.reloadResources(SimpleReloadableResourceManager.java:113) [simpleReloadableResourceManager.class:?]

at net.minecraft.client.Minecraft.refreshResources(Minecraft.java:799) [Minecraft.class:?]

at net.minecraftforge.fml.client.FMLClientHandler.finishMinecraftLoading(FMLClientHandler.java:340) [FMLClientHandler.class:?]

at net.minecraft.client.Minecraft.startGame(Minecraft.java:561) [Minecraft.class:?]

at net.minecraft.client.Minecraft.run(Minecraft.java:386) [Minecraft.class:?]

at net.minecraft.client.main.Main.main(Main.java:118) [Main.class:?]

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_112]

at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_112]

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_112]

at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_112]

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:?]

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_112]

at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_112]

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_112]

at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_112]

at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97) [start/:?]

at GradleStart.main(GradleStart.java:26) [start/:?]

Caused by: net.minecraft.client.renderer.block.model.ModelBlockDefinition$MissingVariantException

at net.minecraft.client.renderer.block.model.ModelBlockDefinition.getVariant(ModelBlockDefinition.java:78) ~[ModelBlockDefinition.class:?]

at net.minecraftforge.client.model.ModelLoader$VariantLoader.loadModel(ModelLoader.java:1184) ~[ModelLoader$VariantLoader.class:?]

at net.minecraftforge.client.model.ModelLoaderRegistry.getModel(ModelLoaderRegistry.java:149) ~[ModelLoaderRegistry.class:?]

 

 

//blockstate

https://github.com/Shane2482/Deadly-World/blob/master/src/main/resources/assets/deadlyworld/blockstates/block_lamp.json

 

//model

https://github.com/Shane2482/Deadly-World/blob/master/src/main/resources/assets/deadlyworld/models/block/lamp.json

 

//texture map for model

https://github.com/Shane2482/Deadly-World/blob/master/src/main/resources/assets/deadlyworld/models/block/lamp_textures.json

Link to comment
Share on other sites

I know this is a older topic but Iv ran into a small prob. When using custom models the default model method doesent work and the item blocks dont render. If I put the model in each of the variants the blocks look fine but nothing I do makes the item render. I have used this method for other blocks that use the MC cube model and it works fine its just when I use a custom model.

 

Item error

 

[08:34:54] [Client thread/ERROR] [FML]: Exception loading model for variant deadlyworld:block_lamp#ison=true,type=black for blockstate "deadlyworld:block_lamp[ison=true,type=black]"

net.minecraftforge.client.model.ModelLoaderRegistry$LoaderException: Exception loading model deadlyworld:block_lamp#ison=true,type=black with loader VariantLoader.INSTANCE, skipping

at net.minecraftforge.client.model.ModelLoaderRegistry.getModel(ModelLoaderRegistry.java:153) ~[ModelLoaderRegistry.class:?]

at net.minecraftforge.client.model.ModelLoader.registerVariant(ModelLoader.java:241) ~[ModelLoader.class:?]

at net.minecraft.client.renderer.block.model.ModelBakery.loadBlock(ModelBakery.java:145) ~[ModelBakery.class:?]

at net.minecraftforge.client.model.ModelLoader.loadBlocks(ModelLoader.java:229) ~[ModelLoader.class:?]

at net.minecraftforge.client.model.ModelLoader.setupModelRegistry(ModelLoader.java:146) ~[ModelLoader.class:?]

at net.minecraft.client.renderer.block.model.ModelManager.onResourceManagerReload(ModelManager.java:28) [ModelManager.class:?]

at net.minecraft.client.resources.SimpleReloadableResourceManager.notifyReloadListeners(SimpleReloadableResourceManager.java:132) [simpleReloadableResourceManager.class:?]

at net.minecraft.client.resources.SimpleReloadableResourceManager.reloadResources(SimpleReloadableResourceManager.java:113) [simpleReloadableResourceManager.class:?]

at net.minecraft.client.Minecraft.refreshResources(Minecraft.java:799) [Minecraft.class:?]

at net.minecraftforge.fml.client.FMLClientHandler.finishMinecraftLoading(FMLClientHandler.java:340) [FMLClientHandler.class:?]

at net.minecraft.client.Minecraft.startGame(Minecraft.java:561) [Minecraft.class:?]

at net.minecraft.client.Minecraft.run(Minecraft.java:386) [Minecraft.class:?]

at net.minecraft.client.main.Main.main(Main.java:118) [Main.class:?]

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_112]

at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_112]

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_112]

at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_112]

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:?]

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_112]

at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_112]

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_112]

at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_112]

at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97) [start/:?]

at GradleStart.main(GradleStart.java:26) [start/:?]

Caused by: net.minecraft.client.renderer.block.model.ModelBlockDefinition$MissingVariantException

at net.minecraft.client.renderer.block.model.ModelBlockDefinition.getVariant(ModelBlockDefinition.java:78) ~[ModelBlockDefinition.class:?]

at net.minecraftforge.client.model.ModelLoader$VariantLoader.loadModel(ModelLoader.java:1184) ~[ModelLoader$VariantLoader.class:?]

at net.minecraftforge.client.model.ModelLoaderRegistry.getModel(ModelLoaderRegistry.java:149) ~[ModelLoaderRegistry.class:?]

 

 

//blockstate

https://github.com/Shane2482/Deadly-World/blob/master/src/main/resources/assets/deadlyworld/blockstates/block_lamp.json

 

//model

https://github.com/Shane2482/Deadly-World/blob/master/src/main/resources/assets/deadlyworld/models/block/lamp.json

 

//texture map for model

https://github.com/Shane2482/Deadly-World/blob/master/src/main/resources/assets/deadlyworld/models/block/lamp_textures.json

 

Your block models weren't working without a model in each variant of the blockstates file due to these limitations of Forge's blockstates format.

 

The lamp_textures.json model does nothing and has no reason to exist, you should use the lamp.json model directly instead.

 

The error you posted is unrelated to item models. Make sure your blockstates file accounts for the limitations linked above, run Minecraft again and post the actual errors for the item models (or the full FML log).

 

Your post is mostly unrelated to the original topic, it probably should have been a new thread. Edit: And now it is.

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

Link to comment
Share on other sites

 

 

The lamp_textures.json model does nothing and has no reason to exist, you should use the lamp.json model directly instead.

 

The error you posted is unrelated to item models. Make sure your blockstates file accounts for the limitations linked above, run Minecraft again and post the actual errors for the item models (or the full FML log).

 

Your post is mostly unrelated to the original topic, it probably should have been a new thread. Edit: And now it is.

 

I have no clue how you found the need to use a dummy value, because that is such an unintuitive requirement.

I had the texture model there because I was using the MC cube method which uses cube_all for the textures, cube for the model, and block for the display. Its nice to know you can combine all of them into one file.

Still having probs with the item

Sry i grabed the wrong error

Heres the full log http://pastebin.com/sdz01d0g and a copy of my new blockstate http://pastebin.com/92M4ZMD3

 

 

Link to comment
Share on other sites

[10:28:33] [Client thread/ERROR] [FML]: Exception loading model for variant deadlyworld:block_lamp#type=white for item "deadlyworld:block_lamp", blockstate location exception:

net.minecraftforge.client.model.ModelLoaderRegistry$LoaderException: Exception loading model deadlyworld:block_lamp#type=white with loader VariantLoader.INSTANCE, skipping

...

Caused by: net.minecraft.client.renderer.block.model.ModelBlockDefinition$MissingVariantException

 

There is no variant in your blockstates file called

type=white

, you need to use

ison=true,type=white

or

ison=false,type=white

instead.

 

The name and value of the dummy property don't matter, but you used the wrong explanation as your dummy values. All of your variants have at least one property (

textures

), it's the fact that this first property was an object that was causing this issue.

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

Link to comment
Share on other sites

 

There is no variant in your blockstates file called

type=white

, you need to use

ison=true,type=white

or

ison=false,type=white

instead.

 

The name and value of the dummy property don't matter, but you used the wrong explanation as your dummy values. All of your variants have at least one property (

textures

), it's the fact that this first property was an object that was causing this issue.

 

Yea I just grabed a dummy from your example for testing now that things are working Ill be cleaning up the code.

Thanks so Much this is a very unfriendly method to use however once you figure it out it makes things so much easier.

Have you thought about doing a tutorial on forge blockstates because for such a powerful method theirs almost no docs for it, and you seem to know quite a bit about it.

 

Finally heres a finished variant

 

"ison=true,type=black": {

      "dummy": "Dummy",

      "textures": {

        "2": "minecraft:blocks/glass_black"

      }

    },

    "ison=false,type=black": {

      "dummy": "Dummy",

      "textures": {

        "2": "deadlyworld:blocks/basalt_carved"

      }

    },

    "type=black": {

      "dummy": "Dummy",

      "textures": {

        "2": "minecraft:blocks/glass_black"

      }

    },

 

Link to comment
Share on other sites

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.