Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (โ‹ฎ) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

[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

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/

  • 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

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.

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.

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...

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions โ†’ Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.