Custom Creative Mode Tabs - 1.8
Very short tutorial. These are useful if your mod is very large and unorganized inside the basic Minecraft tabs.
For these, you must first declare this line of code IN FRONT OF ALL OF YOUR ITEMS/BLOCKS. If you don't do that, the items won't appear.
public static CreativeTabs tutorialTab = new ItemTutorialTab(CreativeTabs.getNextID(), "tutorialTab");
The class ItemTutorialTab will look like this:
package tutorial.tabs;
import net.minecraft.creativetab.CreativeTabs;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public final class ItemTutorialTab extends CreativeTabs
{
public ItemTutorialTab(int par1, String par2Str)
{
super(par1, par2Str);
}
@SideOnly(Side.CLIENT)
public Item getTabIconItem()
{
return Tutorial.myFirstItem;
}
}
In the getTabIconItemIndex method, that declares what item will be the tooltip for your tab.
To name your tab, go into your language file and this line:
itemGroup.tutorialTab =My Mod: Miscellaneous
To add an item or block to a tab, simply add this method to it's class or initializaton.
.setCreativeTab(tutorialTab);
That's it! Let's check out block generation.
For these, you must first declare this line of code IN FRONT OF ALL OF YOUR ITEMS/BLOCKS. If you don't do that, the items won't appear.
public static CreativeTabs tutorialTab = new ItemTutorialTab(CreativeTabs.getNextID(), "tutorialTab");
The class ItemTutorialTab will look like this:
package tutorial.tabs;
import net.minecraft.creativetab.CreativeTabs;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public final class ItemTutorialTab extends CreativeTabs
{
public ItemTutorialTab(int par1, String par2Str)
{
super(par1, par2Str);
}
@SideOnly(Side.CLIENT)
public Item getTabIconItem()
{
return Tutorial.myFirstItem;
}
}
In the getTabIconItemIndex method, that declares what item will be the tooltip for your tab.
To name your tab, go into your language file and this line:
itemGroup.tutorialTab =My Mod: Miscellaneous
To add an item or block to a tab, simply add this method to it's class or initializaton.
.setCreativeTab(tutorialTab);
That's it! Let's check out block generation.