enchant

@Since(version = "2.2")
abstract fun enchant(item: ItemStack, key: NamespacedKey, level: Int, liftedRestrictions: List<EnchantingRestriction>): ItemStackEnchantResponse

Enchants an item with an enchantment, found by this namespaced key, with a given level and a list of liftedRestrictions

Return

the enchanted item wrapped in a response

Throws

if the enchantment was not found