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

I am able to put things in other tabs.... but not the one I just created.

 

How do I put my items in my own tab? here's what I got:

package guru.tbe;

import net.minecraft.creativetab.CreativeTabs;

public class ModCreativeTabs {

public static CreativeTabs TheBasicElements;

public static void load(){

	TheBasicElements = new TBECreativeTab(CreativeTabs.getNextID());
}
}

 

package guru.tbe;

import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.init.Items;
import net.minecraft.item.Item;

public class TBECreativeTab extends CreativeTabs {



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

@Override
public Item getTabIconItem() {
	return guru.tbe.init.GuruItems.NetherOrb;
}

}

 

itemGroup.TheBasicElements=The Basic Elements
item.AirOrb.name=Air Orb
item.EarthOrb.name=Earth Orb
item.FireOrb.name=Fire Orb
item.WaterOrb.name=Water Orb
item.NetherOrb.name=Nether Orb
item.InvisibleOrb.name=Invisible Orb
item.CreativeOrb.name=Creative Orb

 

public static void init()
{
	Item item = (new ItemBucket(Blocks.AIR)).setUnlocalizedName("bucket").setMaxStackSize(16);
	AirOrb = new ItemAirOrb().setUnlocalizedName("AirOrb").setMaxStackSize(64).setCreativeTab(CreativeTabs.COMBAT);
	WaterOrb = new ItemWaterOrb().setUnlocalizedName("WaterOrb").setContainerItem(item).setMaxStackSize(64).setCreativeTab(CreativeTabs.COMBAT);
	EarthOrb = new ItemEarthOrb().setUnlocalizedName("EarthOrb").setMaxStackSize(64).setCreativeTab(CreativeTabs.COMBAT);
	FireOrb = new ItemFireOrb().setUnlocalizedName("FireOrb").setContainerItem(item).setMaxStackSize(64).setCreativeTab(CreativeTabs.COMBAT);
	NetherOrb = new ItemNetherOrb().setUnlocalizedName("NetherOrb").setMaxStackSize(64).setCreativeTab(CreativeTabs.COMBAT);
	InvisibleOrb = new ItemInvisibleOrb().setUnlocalizedName("InvisibleOrb").setMaxStackSize(64).setCreativeTab(CreativeTabs.COMBAT);
	CreativeOrb = new ItemCreativeOrb().setUnlocalizedName("CreativeOrb").setMaxStackSize(64).setCreativeTab(CreativeTabs.MISC);
}

 

 

When I change:

AirOrb = new ItemAirOrb().setUnlocalizedName("AirOrb").setMaxStackSize(64).setCreativeTab(CreativeTabs.COMBAT);

 

To:

AirOrb = new ItemAirOrb().setUnlocalizedName("AirOrb").setMaxStackSize(64).setCreativeTab(CreativeTabs.TheBasicElements);

 

It does not work.

I have also checked to see if this would work:

AirOrb = new ItemAirOrb().setUnlocalizedName("AirOrb").setMaxStackSize(64).setCreativeTab(TBECreativeTab.INVENTORY);

 

no red... but still doesn't work and item doesn't appear.

 

I can't get my items to appear in my tab :| *sigh*

  • Author

and again... no red but no item in the tab.

 

AirOrb = new ItemAirOrb().setUnlocalizedName("AirOrb").setMaxStackSize(64).setCreativeTab(ModCreativeTabs.TheBasicElements);

  • Author
@Mod(modid = Reference.MOD_ID, name = Reference.MOD_NAME, version = Reference.MOD_VERSION)
public class Guru
{
@SidedProxy(clientSide = Reference.CLIENT_PROXY_CLASS, serverSide = Reference.SERVER_PROXY_CLASS)
public static CommonProxy proxy;
@Instance(Reference.MOD_ID)
private static Guru instance;
@EventHandler
public void preInit(FMLPreInitializationEvent event)
{
	proxy.preInit();
	GuruItems.init();
	GuruItems.register();
	GuruEntities.registerEntities();
	ModCreativeTabs.load();
	initRecipes();
}
    @EventHandler
    public void init(FMLInitializationEvent event)
    { 
	proxy.registerRenders();
        proxy.registerKeybindings();
        NetworkRegistry.INSTANCE.registerGuiHandler(instance, proxy);
    }	
private static void initRecipes()
{
	GameRegistry.addRecipe(new ItemStack(GuruItems.AirOrb), new Object[] {" X ", "X X", " X ", 'X', Items.FEATHER});
	GameRegistry.addRecipe(new ItemStack(GuruItems.WaterOrb), new Object[] {" X ",  "X X", " X ", 'X', Items.WATER_BUCKET});
	GameRegistry.addRecipe(new ItemStack(GuruItems.EarthOrb), new Object[] {" X ",  "X X", " X ", 'X', Item.getItemFromBlock(Blocks.DIRT)});
	GameRegistry.addRecipe(new ItemStack(GuruItems.FireOrb), new Object[] {" X ",  "X X", " X ", 'X', Items.LAVA_BUCKET});
	GameRegistry.addRecipe(new ItemStack(GuruItems.NetherOrb), new Object[] {" X ",  "X X", " X ", 'X', Item.getItemFromBlock(Blocks.OBSIDIAN)});
}
public static Guru getInstance()
{
	return instance;
}
}

  • Author

Theres not really a whole bunch of info to learn this stuff on... the only guide i could find on youtube was in german man, im just doing what i can. Thats all i can do.

 

You create your items (

GuruItems.init

) before you call

ModCreativeTabs.load()

so when you call

setCreativeTab

on your items,

ModCreativeTabs.TheBasicElements

is null so you're effectively calling

setCreativeTab(null)

. You need to initialize your creative tab before you create your items/blocks.

Don't make mods if you don't know Java.

Check out my website: http://shadowfacts.net

Developer of many mods

@EventHandler
public void preInit(FMLPreInitializationEvent event)
{
	ModCreativeTabs.load();
	proxy.preInit();
	GuruItems.init();
	GuruItems.register();
	GuruEntities.registerEntities();
	initRecipes();
}

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.