Jump to content

Recommended Posts

Posted

Hello i tried to make an mod. but while starting the game and getting my item i just get an pink and black block. in the console it says: Model definition for location extendedemeralds:EmeraldNugget#inventory not found

here are my files.

emerald_nugget.json (Item Json)

  Reveal hidden contents

ItemEmeraldNugget.java (Item FIle)

  Reveal hidden contents

ExtendedEmeralds.java (Main File)

  Reveal hidden contents

My Folder structure is in the file attached. also in the file you can see that i have an png too!

 

hope someone can help me.

folder struck.PNG

Posted

You should use the registry events to register your items. Here is a good link for reference: http://www.minecraftforge.net/forum/topic/49497-1112-is-using-registryevent-this-way-ok/#comment-249433

 

Don't use Minecraft.getMinecraft().getRenderItem().getItemModelMesher() , use ModelLoader.setCustomResourceLocation.

 

IDs (mod, item, block, etc) should all be lowercase, both in code and assets (class/field names are fine to be mixed case, but registry names modid etc should all be lowercase)

 

Which version of MC/Forge?

 

Also, you should put your code on a github repo, it makes it much easier to look at :) plus version control is cool

Posted (edited)

MC and Forge version 1.8. could you tell me where i typed something in uppercase? because you sayd to type everything in lowercase.

 

 

EDIT: i tried using modelloader and thats my new line : ModelLoader.setCustomModelResourceLocation(enugget, 0, new ModelResourceLocation(MODID + ":emerald_nugget", "inventory"));

 

but i get the same error : [15:16:27] [Client thread/ERROR] [FML]: Model definition for location extendedemeralds:EmeraldNugget#inventory not found

Edited by JohniClark
Posted
  On 8/21/2017 at 1:13 PM, JohniClark said:

MC and Forge version 1.8. could you tell me where i typed something in uppercase? because you sayd to type everything in lowercase.

Expand  

Ok, 1.8 is getting old, so you should really think about updating. I doubt it will continue to be supported for very long, considering we're at 1.12.

 

Continue registering things in init/preinit where applicabile, since the registry events are 1.11+ (although I thought I saw someone say later 1.10.2 had them).

In your main class Init you call GameRegistry.register(enugget, "EmeraldNugget");, I believe that should be lowercase, and the same as your asset names.

Posted
  On 8/21/2017 at 1:30 PM, JohniClark said:

can i add you somewhere. so that you can help me better?

Expand  

You're better off continuing to post here, I'm not always available to help, and there are plenty of others here just as knowledgeable as I am, and even more experienced with forge than me.

Posted (edited)

I know what the problem is but let me mention a couple things before I get to that. Looking at your code I think you probably based your effort off of one of my tutorials or github examples.

 

For an item model to show up, it needs to be 1) instantiated, 2) registered with a registry name 3) have a model JSON file with matching name in proper asset location, 4) have a texture with name pointed to by the model JSON.

 

Recently I've been improving a few things. I don't think they're causing you trouble in your case, but you should still probably update as follows.

 

In the JSON, the one you posted was copied from some vanilla and the scaling was modified because I think I wanted to make a bigger item than normal. If you just want a regular sized model you can use the following instead:

{
    "parent": "item/generated",
    "textures": {
        "layer0": "extendedemeralds:items/emerald_nugget"
    }
}

The second thing is to do what Ugdhar suggested and register using the ModelLoader instead of the item mesher.

 

However, I don't your error is caused by  that in your case it is explicitly telling you that the model is not found. That means it knows there is supposed to be a model therefore it means your item is registered at least as an item. Almost every time this happens to me it means that I have a typographical error somewhere and the names don't match.

 

Now one of the things that changed around 1.8 is they introduced the registry name as being separate from the unlocalized name. The registry name is the string used as the key for the registry and the unlocalized name is used for looking up localization in the lang file. There is no reason for them to be different but they can be so most people keep them the same.

 

Your problem is that when you register in the GameRegistry you use the wrong name -- it doesn't match your model file name. You put "EmeraldNugget" when it should be "emerald_nugget".

 

Generally to avoid having to type the name twice and have chance for errors, people instead now put a setRegistryName() call in the constructor and when using the GameRegistry register method you don't put any string at all. 

 

Be careful if you try to get fancy by trying to get the unlocalized name to set the registry name because the setUnlocalizedName() and getUnlocalizedName() are not symmetric -- you get a different thing back because it adds "item." to the front of the name. I get around this by creating a method for setting both names at once like this:

 

    // Need to call this on item instance prior to registering the item
    // chainable
    public static Item setItemName(Item parItem, String parItemName) {
        parItem.setRegistryName(parItemName);
        parItem.setUnlocalizedName(parItemName);
        return parItem;
       } 

 

Note I personally think it is a very weird thing to have the registry name in the item (or block which works the same way) but that's the way it works.

Edited by jabelar

Check out my tutorials here: http://jabelarminecraft.blogspot.com/

Posted

I did register it as emerald_nugget in the gameregistry afterwards but i still get the same error : [Client thread/ERROR] [FML]: Model definition for location extendedemeralds:emerald_nugget#inventory not found

Posted
  On 8/21/2017 at 6:54 PM, JohniClark said:

I did register it as emerald_nugget in the gameregistry afterwards but i still get the same error : [Client thread/ERROR] [FML]: Model definition for location extendedemeralds:emerald_nugget#inventory not found

Expand  

Post the entire fml-client-latest.log.

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



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • Dear Brunoe Quick Hack (Team) Thank you so much for your remarkable help in recovering my funds after I was scammed. As a busy surgeon and single mother to three children, the loss was overwhelming.Web-Site: Brunoequickhack.COM Your team's hard work, expertise, and unwavering support gave me hope and helped restore my financial stability. I admire your professionalism and the way you genuinely care about your clients. I highly recommend your services to anyone who has fallen prey to scammers. You are truly life savers. Whats-App: +1705-(7842)-635 With heartfelt thanks, Contact information: BrunoequickhackATgmail.cOM Dear Brunoe Quick Hack (Team) Thank you so much for your remarkable help in recovering my funds after I was scammed. As a busy surgeon and single mother to three children, the loss was overwhelming.Web-Site: Brunoequickhack.COM Your team's hard work, expertise, and unwavering support gave me hope and helped restore my financial stability. I admire your professionalism and the way you genuinely care about your clients. I highly recommend your services to anyone who has fallen prey to scammers. You are truly life savers. Whats-App: +1705-(7842)-635 With heartfelt thanks, Contact information: BrunoequickhackATgmail.cOM
    • ok i tried to disable the last mod's i installed and it is some of then, so now im going to do the classic enable and disable trick to find out which mod cause the crash. thanks for the help  
    • ok  make it work (java not being recognize) by downloading the zip putting it in the java folder and manually setting the path but is still give the same crush report https://pastebin.com/PPmR6jN0
    • Install this one: https://www.azul.com/downloads/?version=java-17-lts&os=windows&architecture=x86-64-bit&package=jdk#zulu After installation, set the java version in your Launcher / Java settings
    • it say it requires java 17 so when i go to install it is say "the installer has encounter an unexpected error installing this package." error code 2503 and 2502. https://pastebin.com/AL6AHMM9
  • Topics

×
×
  • Create New...

Important Information

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