Beta
This class represents a collection of enchantments that can be applied to an item.
Creates a new EnchantmentList.
Readonly
The item slot/type that this collection is applied to.
This function can't be called in read-only mode.
Attempts to add the enchantment to this collection. Returns true if successful.
Returns whether or not the provided EnchantmentInstance can be added to this collection.
Returns an enchantment associated with a type.
This function can throw errors.
If this collection has an EnchantmentInstance with type, returns the level of the enchantment. Returns 0 if not present.
Removes an EnchantmentInstance with type from this collection if present.
This class represents a collection of enchantments that can be applied to an item.