Class EnchantmentList

This class represents a collection of enchantments that can be applied to an item.

Hierarchy

  • EnchantmentList

Implements

Constructors

Properties

slot: number

The item slot/type that this collection is applied to.

Methods

  • Returns Iterator<Enchantment, any, undefined>

  • Parameters

    Returns boolean

    Remarks

    Attempts to add the enchantment to this collection. Returns true if successful.

  • Parameters

    Returns boolean

    Remarks

    Returns whether or not the provided EnchantmentInstance can be added to this collection.

  • Parameters

    Returns Enchantment

    Remarks

    Returns an enchantment associated with a type.

  • Parameters

    Returns number

    Remarks

    If this collection has an EnchantmentInstance with type, returns the level of the enchantment. Returns 0 if not present.

  • Parameters

    Returns void

    Remarks

    Removes an EnchantmentInstance with type from this collection if present.