Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

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.

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/

  • 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.

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/

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...

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.