Class EnchantmentListBeta

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

Hierarchy

  • EnchantmentList

Implements

Constructors

  • Parameters

    • enchantmentSlot: number

    Returns EnchantmentList

    Remarks

    Creates a new EnchantmentList.

    This function can't be called in read-only mode.

Properties

slot: number

Remarks

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

Methods

  • Returns Iterator<Enchantment, any, undefined>

    Remarks

    This function can't be called in read-only mode.

  • Parameters

    Returns boolean

    Remarks

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

    This function can't be called in read-only mode.

  • Parameters

    Returns boolean

    Remarks

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

    This function can't be called in read-only mode.

  • Parameters

    Returns Enchantment

    Remarks

    Returns an enchantment associated with a type.

    This function can't be called in read-only mode.

  • Parameters

    Returns number

    Remarks

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

    This function can't be called in read-only mode.

  • Returns IteratorResult<Enchantment, any>

    Remarks

    This function can't be called in read-only mode.

  • Parameters

    Returns void

    Remarks

    Removes an EnchantmentInstance with type from this collection if present.

    This function can't be called in read-only mode.