Jump to content

Recommended Posts

Posted

Hello I have a problem with adding textures to my item in 1.7.10 it was mutch easer but you can always make your mods in 1.7.10. but with adding my textures to my item it gives this error

 [Client thread/ERROR] [FML]: Model definition for location tm:test#inventory not found

 

Main Class

package com.NubNoob.TestMod;

import com.NubNoob.TestMod.init.Testitems;
import com.NubNoob.TestMod.proxy.CommonProxy;

import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.common.Mod.EventHandler;
import net.minecraftforge.fml.common.SidedProxy;
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;

@Mod(modid = "tm", name = "test", version = "1.0")
public class TestMod {

@SidedProxy(clientSide = Reference.CLIENT_PROXY_CLASS, serverSide = Reference.SERVER_PROXY_CLASS)
public static CommonProxy proxy;

@EventHandler
public void preInit(FMLPreInitializationEvent event) 
{
	Testitems.init();
	Testitems.register();
}
    
    @EventHandler
    public void Init(FMLInitializationEvent event) 
    {
    	proxy.registerRenders();
    }
    
    @EventHandler
    public void postInit(FMLPostInitializationEvent event) 
    {
    	
    }
}

 

 

Testitems

package com.NubNoob.TestMod.init;

import com.NubNoob.TestMod.Reference;

import net.minecraft.client.Minecraft;
import net.minecraft.client.resources.model.ModelResourceLocation;
import net.minecraft.item.Item;
import net.minecraftforge.fml.common.registry.GameRegistry;

public class Testitems {

public static Item test;

public static void init()
{
	test = new Item().setUnlocalizedName("test");
}

public static void register()
{
	GameRegistry.registerItem(test, test.getUnlocalizedName().substring(5));
}

public static void registerRenders()
{
	registerRender(test);
}

public static void registerRender(Item item)
{
	Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(item, 0, new ModelResourceLocation(Reference.MOD_ID + ":" + item.getUnlocalizedName().substring(5)));
}
}

 

 

test.json and test.png

{
    "parent": "uu:items/test",
    "display": {
        "thirdperson": {
            "rotation": [ 10, -45, 170 ],
            "translation": [ 0, 1.5, -2.75 ],
            "scale": [ 0.375, 0.375, 0.375 ]
        }
    }
}

The Name of the PNG file is test.pnj

 

 

Tnx for the help

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.