ItemStack

Describes a minecraft item-stack.

Properties

itemDamage

readonly itemDamage: number


maxStackSize

readonly maxStackSize: number


stackSize

stackSize: number

The amount of items in the stack.

Methods

exists()

exists(): boolean

Returns

boolean

Whether the item exists (not null/empty).


getDisplayName()

getDisplayName(): string

Returns

string

The name of the item.


getItemId()

getItemId(): number

Returns

number

The id of the item.


getRemainingDurability()

getRemainingDurability(): number

Returns

number

The remaining durability of the item.


getUnlocalizedName()

getUnlocalizedName(): string

Returns

string

The unlocalized name of the item.


hasEnchantments()

hasEnchantments(): boolean

Returns

boolean

Whether the item has enchantments.


isAxe()

isAxe(): boolean

Returns

boolean

Whether the item is an axe.


isBlock()

isBlock(): boolean

Returns

boolean

Whether the item is a block.


isBroken()

isBroken(): boolean

Returns

boolean

Whether the item is broken.


isDamageable()

isDamageable(): boolean

Returns

boolean

Whether the item can be damaged.


isHoe()

isHoe(): boolean

Returns

boolean

Whether the item is a hoe.


isPickaxe()

isPickaxe(): boolean

Returns

boolean

Whether the item is a pickaxe.


isShovel()

isShovel(): boolean

Returns

boolean

Whether the item is a shovel.


isStackable()

isStackable(): boolean

Returns

boolean

Whether the item can be stacked.


isSword()

isSword(): boolean

Returns

boolean

Whether the item is a sword.


isTool()

isTool(): boolean

Returns

boolean

Whether the item is a tool or weapon.


setNBTData()

setNBTData(): string

Sets the NBT data of the item.

Returns

string

Last updated