Gets a pointer to the enchantment. This method can be used to check if the item has an enchantment and its level.
auto e = Enchantments.protection in item; if(!e || e.level != 5) { item.enchant(Enchantment.protection, 5); } assert(Enchantments.protection in item);
See Implementation
Gets a pointer to the enchantment. This method can be used to check if the item has an enchantment and its level.