Перейти к основному содержанию

ItemContainerSlot

Implements

Index

Constructors

constructor

Properties

count

count: number

data

data: number

extra

id

id: number

Methods

asJson

  • asJson(): JSONObject

asScriptable

clear

  • clear(): void
  • Clears slot contents.


    Returns void

dropAt

  • dropAt(region: BlockSource, x: number, y: number, z: number): void
  • Drops slot contents in given world at given coords.


    Parameters

    Returns void

getContainer

getCount

  • getCount(): number

  • Returns number

    Count of the item in slot.

getData

  • getData(): number

  • Returns number

    Data of the item in slot.

getExtra


  • Returns ItemExtraData

    Extra data object of the item in slot, or null if it is not present in the given item.

getId

  • getId(): number

  • Returns number

    Numeric ID of the item in slot.

getName

  • getName(): string

  • Returns string

    Slot name.

isEmpty

  • isEmpty(): boolean

  • Returns boolean

    Whether the slot is empty or not.

isSavingEnabled

  • isSavingEnabled(): boolean
  • @since

    2.2.0b82


    Returns boolean

markDirty

  • markDirty(): void
  • Refreshes slot in UI.


    Returns void

resetSavingEnabled

  • resetSavingEnabled(): void
  • @since

    2.2.0b82


    Returns void

set

  • set(id: number, count: number, data: number, extra: ItemExtraData): void
  • Sets slot contents.


    Parameters

    Returns void

setSavingEnabled

  • setSavingEnabled(enabled: boolean): void
  • @since

    2.2.0b82


    Parameters

    • enabled: boolean

    Returns void

setSlot

  • setSlot(id: number, count: number, data: number): void
  • setSlot(id: number, count: number, data: number, extra: ItemExtraData): void
  • Sets slot contents.


    Parameters

    • id: number
    • count: number
    • data: number

    Returns void

validate

  • validate(): void
  • Resets slot if it's ID or count equals 0.


    Returns void