Jump to content

Recommended Posts

Posted

Hi,

 

I have been working on a creative tab for Minecraft. It shows up in the creative inventory, but it has no texture (pink and black squares). I tried:

public Item getTabIconItem() {
	return UltraCraft.steelIngot;
}

And here is the code for SteelIngot:

 

package uc.items;

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");
}
}

 

 

Here is the .json file for SteelIngot:

{
"parent": "builtin/generated",
"textures": {
"layer0": "UltraCraft:textures/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 ]
}
}
}

Sup bruh.

Posted

I think you also need to register the item renderer. In the init handling method of your client proxy, you need something like this:

 

        RenderItem renderItem = Minecraft.getMinecraft().getRenderItem();

        renderItem.getItemModelMesher().register(yourItem, 0, new ModelResourceLocation("yourmodid:" + yourItem.getUnlocalizedName().substring(5), "inventory"));

 

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

Posted

Assuming my modid is UltraCraft, and my item is called steelIngot, and the unlocalizedName is "SteelIngot", wouldn't the code be:

 

renderItem.getItemModelMesher().register(steelIngot, 0, new ModelResourceLocation("UltraCraft:models/item/" + yourItem.getUnlocalizedName(), "inventory"));

 

My .json is called SteelIngot.json, and it's located in src\main\resources\assets\UltraCraft\models\item.

Sup bruh.

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.