Tutorial 8. Creative Tab

Before you read, make sure you have seen the previous tutorial

Code is on github and github

So, we got 2 items, but lets make a creative tab for them.
In our main mod file, we create a private Creative tab.
A creative tab, usually needs an id, and a String, presenting the modid.
To get the id, call CreativeTabs.getNextId();
The modid is ofcourse our modid.
Also, to get our modid, lets make a getter

Now, i like to make a new package, called creativetab. In there, i make my McModTutoriaTab class. The constructor sends the id and modid forward to the super class. Now, we need to implement one method, because we extend CreativeTab.

The method is getTabIconItem. That method returns what icon should be displayed on the tab. In my case, I return my testItem.


So, 2 things left, Adding a name for our tab, and adding items to our tab.
For the name, go to your language file, and add this.

so, itemGroup.[modid]=[Ingame Name]

Lastly, go to your TestBlock  and TestItem, and change the creative tabs.

Back to List
Next tutorial

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">