Link to creative-tab
This allows you to add Creative Tabs to the game!
Creating the ICreativeTab object
Link to creating-the-icreativetab-object
Before you can add the tab, you need to create a representation which will allow you to set the properties of the tab you want to add.
This is where the VanillaFactory comes in:
mods.contenttweaker.VanillaFactory.createCreativeTab(String unlocalizedName, IItemStack iItemStack); mods.contenttweaker.VanillaFactory.createCreativeTab(String unlocalizedName, ItemRepresentation iItem); mods.contenttweaker.VanillaFactory.createCreativeTab(String unlocalizedName, BlockRepresentation iBlock); mods.contenttweaker.VanillaFactory.createCreativeTab(String unlocalizedName, IItemStackSupplier supplier);
The String is in each of the three methods the same: It's the unlocalized name the Tab will later have.
The second parameter is the symbol your tab will carry later on (e.g. a lava bucket for "misc").
You can decide wheter you want to use an itemRepresentation, an itemStack, a blockrepresentation or an itemStackSupplier function.
Calling an existing ICreativeTab object
Link to calling-an-existing-icreativetab-object
You can also call an existing creative tab, though you cannot change any of it's properties.
Why would you need this, you ask?
You will need this if you want to add a newly created block or item to an existing tab!
Link to properties
You can call and set all these properties using the normal ZenGetters and ZenSetters
tab.unlocalizedName = "hh";
Note that you will probably hardly ever need the Setters as these Properties are already initialized to your wanted values when you create the ICreativeTab object.
Also, you can neither set nor get properties from an existing ICreativeTab(one that you retrieved using the Bracket handler)!
|Property Name||Type||Required||Default Value||Description/Notes|
Description/NotesThe Creative Tab's name
Description/NotesThe Creative Tab's icon
Registering the creative tab
Link to registering-the-creative-tab
You need to call this method to register the creative Tab in the game!
Otherwise nothing will happen!
After you have called this function, you cannot un-register the tab or change any of it's properties!
Link to example-script
#loader contenttweaker import mods.contenttweaker.CreativeTab; import mods.contenttweaker.VanillaFactory; val zsTab = VanillaFactory.createCreativeTab("contenttweaker", <minecraft:dragon_egg>); zsTab.register();