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

I have followed a couple tutorials and managed to get a 3D item to render in game but the issue I am having is that it has no icon and I am having trouble figuring out exactly how to fix this.

 

Below is my source code:

https://github.com/G1R-Productions/g1rwarcraft

 

If anyone could help with this issue it would be most appreciated.

  • Author

Could you possibly give an example? I have tried both and the texture is an invisible texture in the inventory. (I am rather new to modding I have only being modding for about 2.5 weeks.)

Hi

 

To just use the 2D inventory icon for the sword, change your ItemRender3Dtool to have

 

@Override
    public boolean handleRenderType(ItemStack item, ItemRenderType type) {
        return (type == ENTITY || type == EQUIPPED || type == EQUIPPED_FIRST_PERSON);
    }

 

And make sure you have included the image you register in registerIcons.

 

public class testSword extends ItemSword {

public testSword(ToolMaterial arg0) {
	super(arg0);
	this.setCreativeTab(grwarcraft.g1rwarcraft);
}

@SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister iconRegister) {
	this.itemIcon = iconRegister.registerIcon(grwarcraft.modid + ":" + this.getUnlocalizedName().substring(5));

}
}

 

 

-TGG

  • Author

Using this code for rendering them item in 3d in the inventory the icon is blank.

 

        case INVENTORY:
        	GL11.glPushMatrix();

        	Minecraft.getMinecraft().renderEngine.bindTexture(new ResourceLocation(
        	"grwarcraft:/sword1.png"));

        	GL11.glRotatef(0.0F, 0.0f, 0.0f, 0.0f);
        	GL11.glRotatef(0.0F, 0.0f, 0.0f, 0.0f);
        	GL11.glTranslatef(0.0F, 0.0F, 0.0F);
        	GL11.glPopMatrix();
        	break;

 

Using this code it says it cannot be resolved to a variable.

 

@Override
    public boolean handleRenderType(ItemStack item, ItemRenderType type) {
        return (type == ENTITY || type == EQUIPPED || type == EQUIPPED_FIRST_PERSON);
    } 

 

I also have an icon registered with the item:

 

		item3dtool = new GRItems().setTextureName("grwarcraft:/sword1").setUnlocalizedName("3dtool");
	GameRegistry.registerItem(item3dtool, "3dtool");

 

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.