Jump to content

Creating a Creative Tab (Minecraft 1.9)


Quizer9O8

Recommended Posts

Hi,

 

I'm currently in the making of a mod and I want to create a own Creative Tab, so I went looking for tutorials how to do so.

Sadly these tutorials were outdated so can someone of you be so kind to send me an example so I can Implement it in my mod?

Link to comment
Share on other sites

The 1.8 tutorials should work in 1.9

 

But here, I use this:

 

TAB = new CreativeTabs(MOD_ID + ":" + TAB_NAME)
{
@Override
public Item getTabIconItem()
{
	return TAB_ICON;
}
};

 

in FMLPreInitializationEvent, before initializing anything else.

Link to comment
Share on other sites

Use the one-argument constructor of

CreativeTabs

instead of the two-argument one and it will automatically use the next free ID for you.

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

Link to comment
Share on other sites

Use the one-argument constructor of

CreativeTabs

instead of the two-argument one and it will automatically use the next free ID for you.

 

Oh, right. I was going to use that but an error occured because CreativeTabs is abstract, didn't notice and changed the constructor. I must have forgotten to change it back when I realised it was abstract.

Link to comment
Share on other sites

I have something like this:

 

Loading class

public class ModCreativeTabs {

public static CreativeTabs tetraTab;

public static void load(){

	tetraTab = new TetraCreativeTab(CreativeTabs.getNextID());
}
}

 

The Class

public class TetraCreativeTab extends CreativeTabs {

public TetraCreativeTab(int id) {
	super("tetracraft");
	//this.setBackgroundImageName("item_search.png");
}

@Override
public Item getTabIconItem() {
	return ModItems.triaxIngot;
}

/**
 * Determines if the search bar should be shown for this tab.
 *
 * @return True to show the bar
 */
/*@Override
public boolean hasSearchBar() {
	return getTabIndex() == this.getTabIndex();
}*/

}

 

Main Mod Class

	@EventHandler
public void preInit(FMLPreInitializationEvent event){
	ModCreativeTabs.load();
.....
}

Main Developer and Owner of Zero Quest

Visit the Wiki for more information

If I helped anyone, please give me a applaud and a thank you!

Link to comment
Share on other sites

Not easily.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

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.