Posted April 17, 201510 yr 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.
April 17, 201510 yr 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/
April 17, 201510 yr Author 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.
April 18, 201510 yr It is important to always use all lower case for the modid as well as the unlocalized names. I think it has to do with file system compatibility. Also, in your example there is still a "yourItem" that you need to replace with the steel ingot item name. Check out my tutorials here: http://jabelarminecraft.blogspot.com/
April 18, 201510 yr Hi You might find this tutorial project useful (see MBE10) https://github.com/TheGreyGhost/MinecraftByExample Also this troubleshooting guide http://greyminecraftcoder.blogspot.com.au/2015/03/troubleshooting-block-and-item-rendering.html -TGG
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.