disenchant

@Since(version = "2.2")
abstract fun disenchant(item: ItemStack, key: NamespacedKey): ItemStack

Disenchants an item - removes an enchantment, found by a key

Return

the disenchanted item

Throws

if the enchantment was not found, or if the item doesn't have the given enchantment


@Since(version = "2.2")
abstract fun disenchant(player: Player, slot: EquipmentSlot, key: NamespacedKey)

Disenchants a player's item - removes an enchantment, found by this namespaced key, in a given slot

Throws

if the enchantment was not found, or if the item doesn't have the given enchantment