Jump to content

How Do I Put My Items In My Creative Tab? (1.10.2) [solved]


Recommended Posts

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*

Posted

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

 

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

Posted
@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;
}
}

Posted

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.

 

Posted

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

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

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • I tried do download the essential mod to my mod pack but i didnt work. I paly on 1.21 and it should work. I use neoforge for my modding. The weird things is my friend somehow added the mod to his modpack and many others that I somehow can´t. Is there anything i can do? 
    • Thanks, I've now installed a slightly newer version and the server is at least starting up now.
    • i have the same issue. Found 1 Create mod class dependency(ies) in createdeco-1.3.3-1.19.2.jar, which are missing from the current create-1.19.2-0.5.1.i.jar Found 11 Create mod class dependency(ies) in createaddition-fabric+1.19.2-20230723a.jar, which are missing from the current create-1.19.2-0.5.1.i.jar Detailed walkthrough of mods which rely on missing Create mod classes: Mod: createaddition-fabric+1.19.2-20230723a.jar Missing classes of create: com/simibubi/create/compat/jei/category/sequencedAssembly/JeiSequencedAssemblySubCategory com/simibubi/create/compat/recipeViewerCommon/SequencedAssemblySubCategoryType com/simibubi/create/compat/rei/CreateREI com/simibubi/create/compat/rei/EmptyBackground com/simibubi/create/compat/rei/ItemIcon com/simibubi/create/compat/rei/category/CreateRecipeCategory com/simibubi/create/compat/rei/category/WidgetUtil com/simibubi/create/compat/rei/category/animations/AnimatedBlazeBurner com/simibubi/create/compat/rei/category/animations/AnimatedKinetics com/simibubi/create/compat/rei/category/sequencedAssembly/ReiSequencedAssemblySubCategory com/simibubi/create/compat/rei/display/CreateDisplay Mod: createdeco-1.3.3-1.19.2.jar Missing classes of create: com/simibubi/create/content/kinetics/fan/SplashingRecipe
    • The crash points to moonlight lib - try other builds or make a test without this mod and the mods requiring it
    • Do you have shaders enabled? There is an issue with the mod simpleclouds - remove this mod or disable shaders, if enabled  
  • Topics

×
×
  • Create New...

Important Information

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