Class ItemExtraData

Class representing item extra data. Used to store additional information about item other then just item ID and data.

Constructors

Methods

  • Adds a new enchantment to the item.

    Parameters

    • type: number

      enchantment ID, one of the EEnchantment constants

    • level: number

      enchantment level, generally between 1 and 5

    Returns void

  • Returns string

    All enchantments names separated by line breaks.

  • Parameters

    • name: string

      parameter name

    • Optionalfallback: boolean

      default value to be returned if item extra data doesn't contain a parameter with specified name

    Returns boolean

    Custom boolean parameter value if extra data of the item contains one, fallback value otherwise. If fallback was not specified, null is returned.

  • Returns number

    Amount of enchantments applied to the item.

  • Parameters

    • type: number

      enchantment ID, one of the EEnchantment constants

    Returns number

    Level of the specified enchantment.

  • Parameters

    • id: number

      enchantment ID, one of the EEnchantment constants

    • level: number

      enchantment level, generally between 1 and 5

    Returns string

    Enchantment name by it's ID and level.

    2.2.1b94 (not worked before)

  • Returns {
        [id: number]: number;
    }

    • [id: number]: number
  • Parameters

    • name: string

      parameter name

    • Optionalfallback: number

      default value to be returned if item extra data doesn't contain a parameter with specified name

    Returns number

    Custom float parameter value if extra data of the item contains one, fallback value otherwise. If fallback was not specified, null is returned.

  • Parameters

    • name: string

      parameter name

    • Optionalfallback: number

      default value to be returned if item extra data doesn't contain a parameter with specified name

    Returns number

    Custom integer parameter value if extra data of the item contains one, fallback value otherwise. If fallback was not specified, null is returned.

  • Parameters

    • name: string

      parameter name

    • Optionalfallback: number

      default value to be returned if item extra data doesn't contain a parameter with specified name

    Returns number

    Custom long integer parameter value if extra data of the item contains one, fallback value otherwise. If fallback was not specified, null is returned.

  • Parameters

    • name: string

      parameter name

    • Optionalfallback: string

      default value to be returned if item extra data doesn't contain a parameter with specified name

    Returns string

    Custom string parameter value if extra data of the item contains one, fallback value otherwise. If fallback was not specified, null is returned.

  • Returns boolean

    true, if item extra exists and is not empty.

  • Returns boolean

    true if the item is enchanted, false otherwise.

  • Puts some custom boolean parameter to the extra data of the item.

    Parameters

    • name: string

      parameter name

    • bool: boolean

      parameter value

    Returns ItemExtraData

    Reference to itself to be used in sequential calls.

  • Puts some custom floating point number parameter to the extra data of the item.

    Parameters

    • name: string

      parameter name

    • float: number

      parameter value

    Returns ItemExtraData

    Reference to itself to be used in sequential calls.

  • Puts some custom integer parameter to the extra data of the item.

    Parameters

    • name: string

      parameter name

    • int: number

      parameter value

    Returns ItemExtraData

    Reference to itself to be used in sequential calls.

  • Puts some custom long integer parameter to the extra data of the item.

    Parameters

    • name: string

      parameter name

    • long: number

      parameter value

    Returns ItemExtraData

    Reference to itself to be used in sequential calls.

  • Puts some custom string parameter to the extra data of the item.

    Parameters

    • name: string

      parameter name

    • value: string

      parameter value

    Returns ItemExtraData

    Reference to itself to be used in sequential calls.

  • Removes all the enchantments of the item.

    Returns void

  • Removes all custom parameters from item extra data.

    Returns void

  • Removes enchantments by it's ID.

    Parameters

    • type: number

      enchantment ID, one of the EEnchantment constants

    Returns void

  • Sets compound tag for the specified item.

    Parameters

    Returns void

    2.0.5b44

  • Sets item's custom name.

    Parameters

    • name: string

    Returns void

Copyright © 2024 Nernar. Copyright © 2020 #mineprogramming. Built with ❤ and TypeDoc.