Jump to content

Recommended Posts

Posted

I have no idea why but this doesn't work:

 

TAB:

public class RoATab extends CreativeTabs
{
Item icon;

public RoATab(String lable, Item icon)
{
	super(lable);
	this.icon = icon;
}

@Override
public Item getTabIconItem() 
{
	return icon;
}
}

InitTabs:

	RoATab TabWeapons = new RoATab("RoAWeapons", Items.iron_sword);

ITEM:

public class ItemCore extends Item
{
public ItemCore(String UN, CreativeTabs Tab)
{
	super();
	GameRegistry.registerItem(this, UN);
	setUnlocalizedName(UN);
	setTextureName(InitUtil.ModID + ":" + UN);
	this.setCreativeTab(Tab);
}
.......
...
.

InitItems:

	MyItem = 	new ItemCore("Steel", InitTabs.TabWeapons);

 

SAME code works with Blocks (I mean this tab and setCreativeTab() works with extended Block)

 

Any idea? Is Item tab declaration different?

 

Note: setCreativeTab(tab) doesn't work only if I place there my Tab name, vanilla ones work.

 

1.7.10 is no longer supported by forge, you are on your own.

Posted

Bro, I wouldn't be here wihtout making sure it is not my mistake.

 

Alredy done step by step initialization. Tabs alredy exist when I declare items.

 

Fun fact: :)

mloyrk.jpg

 

Well, I think I'm just gonna cleanup workspace, maybe there is some troll code somewhere from .git

1.7.10 is no longer supported by forge, you are on your own.

Posted

I just made my tab like this inside my main class:

 

public static CreativeTabs tabName = new CreativeTabs("tabName") {

	@Override
	public Item getTabIconItem() {

		return Items.apple;

	}

};

Posted

Where are you registering your tab?

Also where are you set the ID of your tab?

You should make a class for your tab not just in your main class.

Can we see your posInit please?

Posted

That is literally it, nothing in my init methods. I think it just creates an ID depending on what isn't used. It works fine and I can easily set an item to appear in the tab.

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.