Posted May 20, 201411 yr [move][glow=red,2,300]Question:[/glow] Does anyone know how to organize items 'n stuff in a CreativeTab?[/move] Hey guys! I have added a few items to my Creative Tab in my mod, but they are all not organized; I want swords with swords, items with items and so on. How do I do that? I searched all over the internet, looking at many websites and tutorials, but I cannot find it. Creator of the Extended Items Mod: Download v0.05
May 20, 201411 yr Okay, I haven't tried this but I think it might work. First of all, the order they appear is the order they are added to the tab. The mistake most people make is thinking they have to set the creative tab at same time as they create or register the item and so end up with a order they don't like, but actually setting the creative tab is just a method that can be called at any time. So all you need to do set all the creative tabs in the order you want them. Note you can also delete items from the creative tabs, including (I think) the vanilla items and re-add them in different order like: Item.getItemByID(400).setCreativeTab(null); // should remove pumpkin_pie from the food creative tab Check out my tutorials here: http://jabelarminecraft.blogspot.com/
May 23, 201411 yr Author Override displayAllReleventItems . In there first call the super method to let it fill the list, then sort it with a Comparator. I am a new to coding, I have done plugins before, but this is obviously different, so I do not know what many things are. I only know the 'basics'. I have tried to add this.displayAllReleventItems(arg0), but then I get errors with the String in the displayAllReleventItems. This is my code from the CreativeTab class package com.Greenadine.ExtendedItemsMod.CreativeTabs; import com.Greenadine.ExtendedItemsMod.ExtendedItemsMod; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.Item; public class TabExtendedItemsModItems extends CreativeTabs { public TabExtendedItemsModItems(int arg0, String arg1) { super(arg0, arg1); this.displayAllReleventItems(arg0); } @Override public Item getTabIconItem() { return ExtendedItemsMod.SuperiteGem; } } It gives the error "The method displayAllReleventItems(List) in the type CreativeTabs is not applicable for the arguments (int)" at this.displayAllReleventItems. I do not know what to do next. And how do I organize it with a Comperator, because I do not know what it is. But thanks already for the help! Creator of the Extended Items Mod: Download v0.05
May 23, 201411 yr LTPIJ: Learn to program in Java! You didn't override anything as Diesieben07 told you. Calling a method with some random parameter is just plain wrong. Use you IDE to add the override - then you can get the proper argument types. If you don't know how, then you are going to seriously fail at modding Minecraft. Nothing personal. -S- (if I helped, please click Thank and applaud) http://6upnqa.dm2301.livefilestore.com/y2mtf-vG7Tqq1TiiVpIm53KWj7294NDPoHfSHHb4PzZiMAUfRCfK0UY0MwOu7Q3zTBNVTKqWjr2-xgBfFRpQT5p-QivtvknPpoABMNUw9br9WuZcBFkjePhnAbW500gVm-P/sequiturian.png[/img]
May 23, 201411 yr Override displayAllReleventItems. In there first call the super method to let it fill the list, then sort it with a Comparator. This means that you create a method in your class with the same modifier (public/protected), return (probably void in this case), and parameters.(the things that are inputs in this case a list) This means that in this new method you create, add super.displayAllReleventItems(list), where list is the list in the parameters. This means to use some sort of comparator to change the order of the list. Take a look at this http://www.tutorialspoint.com/java/java_using_comparator.htm and apply that to your item base class. Alternatively you could use jabelar's suggestion.
May 25, 201411 yr Author SOLVED! It will be displayed as how it is ordered in the GameRegistry. Creator of the Extended Items Mod: Download v0.05
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.