Jump to content

[1.8] [SOLVED] Error loading .json file?


TheDogePwner

Recommended Posts

Hi,

I have a texture for an item that doesn't load (has default texture).

Here is the debug output:

[11:01:06] [Client thread/ERROR] [FML]: Model definition for location ultracraft:item.SteelIngot#inventory not found

Here is the .json file:

 

{

    "parent": "builtin/generated",

    "textures": {

        "layer0": "ultracraft:items/SteelIngot"

    },

    "display": {

        "thirdperson": {

            "rotation": [ -90, 0, 0 ],

            "translation": [ 0, 1, -3 ],

            "scale": [ 0.55, 0.55, 0.55 ]

        },

        "firstperson": {

            "rotation": [ 0, -135, 25 ],

            "translation": [ 0, 4, 2 ],

            "scale": [ 1.7, 1.7, 1.7 ]

        }

    }

}

 

Here is how I set the texture in the init method:

 

steelIngot = new SteelIngot();

 

ItemModelMesher mesher = Minecraft.getMinecraft().getRenderItem().getItemModelMesher();

String name = UltraCraft.MODID + ":" + steelIngot.getUnlocalizedName();

mesher.register(steelIngot, 0, new ModelResourceLocation(name, "inventory"));

 

GameRegistry.registerItem(steelIngot, steelIngot.getUnlocalizedName(), UltraCraft.MODID);

 

 

And here is my SteelIngot class:

 

package uc.items;

 

import net.minecraft.creativetab.CreativeTabs;

import net.minecraft.item.Item;

import net.minecraftforge.fml.common.Mod.EventHandler;

import net.minecraftforge.fml.common.event.FMLInitializationEvent;

import net.minecraftforge.fml.common.registry.GameRegistry;

import uc.mainmod.UltraCraft;

 

public class SteelIngot extends Item {

public SteelIngot() {

setMaxStackSize(64);

setCreativeTab(UltraCraft.mechanicalItemsTab);

setUnlocalizedName("SteelIngot");

}

}

 

Sup bruh.

Link to comment
Share on other sites

Your JSON file is called

SteelIngot.json

, but you tell it to search for

item.SteelIngot.json

...

Don't PM me with questions. They will be ignored! Make a thread on the appropriate board for support.

 

1.12 -> 1.13 primer by williewillus.

 

1.7.10 and older versions of Minecraft are no longer supported due to it's age! Update to the latest version for support.

 

http://www.howoldisminecraft1710.today/

Link to comment
Share on other sites

yeah, I think I responded to same/similar question on other thread. For some dumb reason, the getUnlocalizedName() is not symmetric with the setUnlocalizedName() because you'll get back the name with "item." prepended to your name. So I usually add a .substring(5) to the getUnlocalizedName() to get just the name.

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

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.

Announcements



×
×
  • Create New...

Important Information

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