The ItemUtils interface provides various item utils.
It can be accessed using the items keyword.

Creating Potions

The createPotions function allows you to create custom potions.
Returns the potion as IItemStack.
As the Parameter for this function is a vararg, you can either provide one Object[][] or many Object[].
In both cases each Object[] needs to contain

  1. An IPotion
  2. An int describing the effect amplifier/strength
  3. An int describing the effect duration.

If an Object[] is not of this length or not in this order, it will be ignored.

//createPotion([effect,strength,duration],[effect2, strength2,duration2],...);
//createPotion([[effect,strength,duration],[effect2, strength2,duration2],...]);
val potion = itemUtils.createPotion([[<potion:minecraft:strength>, 1, 1]]);

Get Items by name

These two functions both return an IItemStack[] containing all matching items.
The first checks against the items’ registry names, the 2nd uses the unlocalized names.

//getItemsByRegexRegistryName(String Regex)

//getItemsByRegexUnlocalizedName(String Regex)

Create Spawn egg

The createSpawnEgg function allows you to create custom mod spawn eggs.
The customNBT is OPTIONAL and can override the entity tag.
Returns the spawn eff as IItemStack.

//createSpawnEgg(entity, @optional customNBT)
//NBT overrides entity (this creates a creeper egg!)
val egg = itemUtils.createSpawnEgg(<entity:minecraft:sheep>, {EntityTag:{id:"minecraft:creeper",NoAI:1 as byte,PersistenceRequired:1 as byte}});