setPotion

fun ItemStack.setPotion(potionHolder: Holder<Potion>)(source)

Sets the given potion for this ItemStack.

If you want to pass a custom potion, make sure to register it in the potion registry first.

Example usage:

itemStack(Items.POTION) {
setPotion(Potions.HEALING)
}

fun ItemStack.setPotion(potion: Potion)(source)

Deprecated

Use the setPotion function with a holder instead. This function searches for the holder in the potion registry for compatibility only!