Jump to content

Recommended Posts

Posted

Hi togehter,

 

In my mod I define an item-class which is used for several items with different properties.

Every single kind of this item has an own unlocalized name ("item_diarybook_digger_day_" + an integer) - but every kind of the item has the same texture.

 

Then I try to register the item using

 Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(ModItems.item_diarybook_digger[i], 0, new ModelResourceLocation(modid + ":item_diarybook_digger", "inventory"));

 

I hoped that a single Model-Definition, named "item_diarybook_digger.json" can be used, but I get the model definition not found error

 

[Client thread/ERROR] [FML]: Exception loading model for variant testmod:item_diarybook_digger_day_365#inventory for item "testmod:item_diarybook_digger_day_365"
java.lang.Exception: Could not load model definition for variant testmod:item_diarybook_digger_day_365#inventory

 

Is it possible to use one model-definition file for serveral items? If so: What I'm doing wrong?

 

Thanks and best,

 

minquist

Posted

Yes, it is totally possible.

What are you doing wrong?

  • How is the unlocalized name relevant here?
  • Use
    ModelLoader.setCustomModelResourceLocation

    in preInit, not the

    ItemModelMesher

    .

  • Why generate the ModelResourceLocation painfully manually like that?
    new ModelResourceLocation(item.getRegistryName(), "inventory")

    will work fine and allow you to use the same for every item.

  • Why are you still on 1.8.9?

 

If that does not fix it, post more of your code.

 

Thanks, that helped a lot. Don't know really why it was a problem. ;-)

 

We are using 1.8.9 because we don't want to have some 1.9 and 1.10 features of Minecraft within our project.

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.