SerenityJS
    Preparing search index...
    Index

    Constructors

    Properties

    container: null | Container = null

    The container the item stack is in. If the item stack is not in a container, this will be null.

    identifier: string

    The identifier of the item stack.

    isStackable: boolean = true

    Whether the item stack is stackable. If true, the item stack can be stacked with other item stacks of the same type.

    maxStackSize: number = 64

    The maximum stack size of the item stack. This is the maximum amount of items that can be stacked in a single item stack.

    The nbt data of the item stack.

    type: ItemType

    The type of the item stack.

    world: World

    The world the item stack is in.

    Accessors

    Methods

    • Adds a trait to the itemstack.

      Type Parameters

      Parameters

      • trait: ItemStackTrait | K

        The trait to add to the itemstack.

      • Optionaloptions: ConstructorParameters<K>[1]

        The additional options to pass to the trait.

      Returns InstanceType<K>

      The trait instance that was added to the itemstack.

    • Decrements the size of the item stack.

      Parameters

      • Optionalsize: number

        The size to decrement.

      Returns void

    • Get the display name of the item stack.

      Returns string

      the display name of the item stack.

      This method depends on the ItemStackDisplayTrait.

    • Get a dynamic property from the item stack.

      Type Parameters

      Parameters

      • key: string

        The key of the dynamic property.

      Returns null | T

      The dynamic property value, or null if it does not exist.

    • Get the lore of the item stack.

      Returns string[]

      The lore of the item stack.

      This method depends on the ItemStackDisplayTrait.

    • Get the slot of the item stack in its container.

      Returns number

      The slot of the item stack, or -1 if not in a container.

    • Check if the item stack has a dynamic property.

      Parameters

      • key: string

        The key of the dynamic property.

      Returns boolean

      Whether the item stack has the dynamic property.

    • Increments the size of the item stack.

      Parameters

      • Optionalsize: number

        The size to increment.

      Returns void

    • Remove a dynamic property from the item stack.

      Parameters

      • key: string

        The key of the dynamic property.

      Returns void

    • Set the auxiliary value of the item stack.

      Parameters

      • value: number

        The auxiliary value to set.

      Returns void

    • Set the display name of the item stack.

      Parameters

      • name: null | string

        The display name to set for the item stack.

      Returns void

      This method depends on the ItemStackDisplayTrait, or adds it if it does not exist.

    • Set the lore of the item stack.

      Parameters

      • lore: string[]

        The lore to set for the item stack.

      Returns void

      This method depends on the ItemStackDisplayTrait, or adds it if it does not exist.

    • Set the slot of the item stack in its container.

      Parameters

      • value: number

        The slot to set the item stack to.

      Returns void

      The slot of the item stack, or -1 if not in a container.

    • Start a cooldown for the item stack.

      Parameters

      • duration: number

        The duration of the cooldown in ticks.

      Returns void

    • Converts the item stack to a network item instance descriptor. Which is used on the protocol level.

      Parameters

      Returns NetworkItemInstanceDescriptor

      The network item instance descriptor.

    • Converts the item stack to a network item stack descriptor. Which is used on the protocol level.

      Parameters

      Returns NetworkItemStackDescriptor

      The network item stack descriptor.