Home Getting Started With Scripts Using this wiki Commands CTGUI Global functions Bracket Handlers
ContentTweaker Commands WalkThrough

Vanilla Factory

The Vanilla Factory allows you to create Blocks, Items and Creative Tabs that you can then add to the game.

Calling

You can find the package at mods.contenttweaker.VanillaFactory

Creating Content

Create Blocks

script.zs
mods.contenttweaker.VanillaFactory.createBlock(String unlocalizedName, IMaterialDefinition material);

Parameters:

  • String unlocalizedName: The Block’s unlocalized name.
  • IMaterialDefinition material: The base material the block is made of.

Returns a BlockRepresentation object. Check the Block page for further information and an example script!

Create Items

script.zs
mods.contenttweaker.VanillaFactory.createItem(String unlocalizedName);

Parameters:

  • String unlocalizedName: The item’s unlocalized name.

Returns an ItemRepresentation object. Check the Item page for further information and an example script!

Create Creative Tabs

script.zs
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);

Parameters:

  • String unlocalizedName: The Tab’s unlocalized Name.
  • Item or Block representation: The Item/Block to be displayed as the Tab’s symbol. Alternatively you can use an IItemStackSupplier function.

Returns a ICreativeTab object. Check the Creative Tab page for further information and an example script!

Create Fluids

script.zs
mods.contenttweaker.VanillaFactory.createFluid(String unlocalizedName, int color);
mods.contenttweaker.VanillaFactory.createFluid(String unlocalizedName, CTColor color);

Parameters:

  • String unlocalizedName: The Fluid’s unlocalized name.
  • int color: The fluid’s color-code.
  • CTColor color: The fluid’s color as color-Object.

Returns a FluidRepresentation object. Check the Fluid page for further information and an example script.

Create Food Items

script.zs
mods.contenttweaker.VanillaFactory.createItemFood(String unlocalizedName, int healAmount);

Parameters:

  • String unlocalizedName: The item’s unlocalized Name.
  • int healAmount: The Food Value

Returns an ItemFoodRepresentation object. Check out the Food page for further information and an example script.