enchant

fun enchant(enchantment: Enchantment, level: Int = 1, ignoreLevelRestriction: Boolean = true)

Adds an enchantment to the ItemStack.

Parameters

enchantment

The enchantment to add

level

The enchantment level (default: 1)

ignoreLevelRestriction

Whether to ignore max level restrictions (default: true)