Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

Hello, I am messing around with creating various things in 1.8.9 in an attempt to get a better feel for the new model system. Right now I am trying to create a basic helmet which changes the armor texture and the item texture depending on the value of the design tag in the ItemStack NBT. I have read through a few other topics on changing the item texture/model depending on the NBT or other conditions, and have found a way to do what I am trying to achieve. The way I am attempting makes use of a custom ItemMeshDefinition which allows me to change the ModelResourceLocation based on an ItemStack. The other topics I have read, along with the 1.8.9 Rendering Primer document that has been going around say that I must first bake the models using ModelLoader#registerItemVariants and passing it all the ResourceLocations pointing to my variants, and then I must use  ModelLoader#setCustomMeshDefinition to apply my custom ItemMeshDefinition. I believe that I have done both of those things correctly, however my item still has the over sized block model, and the purple/black missing texture look. I have also compared my code against code found in the 1.8 port of Botania (the mana gun and other items use the same approach) however I couldn't find any differences or things I might have left out. This issue has really stumped me, and I would really appreciate it if someone could give my code a look over.

 

Some important notes

-Right now I have only creates json models for 3/16 of my current designs.

-The 3 designs that have json models are not listed in the console output of missing models, the other 13 are.

-The models I am using use a custom parent model to cut down on the size of my json files. This seems to be a common thing, however it is worth mentioning.

 

The entire source for this mod is public on GitHub however here are some other important files

Mod Class

Main Mod Class

Mesh Definition

Model Files

Item Class

You have a few problems:

  • Your item textures are in textures/item instead of textures/item.
  • You're registering your models in init.
    ModelLoader.setCustomMeshDefinition

    only works if called before init.

  • You're returning a
    ModelResourceLocation

    with the default

    "normal"

    variant from your

    Deadmau5MeshDefinition

    , but the

    builtin/generated

    model only provides the 

    "inventory"

    variant.

 

I've forked your mod on GitHub and fixed these problems. You can see what I changed and/or merge the changes here.

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.

  • Author

Thank you for having a look at the project, you were spot on with the problems you found. Some of them such as the textures being in the wrong directory were pretty foolish on my part :P Also, thank you for creating a fork of the repository, that was far more then I could have hoped for, and I really appreciate it.

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...

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.