The identifier or item type of the item stack.
Optional
options: Partial<ItemStackOptions>The options for the item stack.
The amount of the item stack.
The container the item stack is in. If the item stack is not in a container, this will be null.
Readonly
dynamicThe dynamic properties of the item stack.
Readonly
identifierThe identifier of the item stack.
The metadata value of the item stack.
Readonly
nbtThe nbt data of the item stack.
Readonly
traitsThe traits of the item stack.
Readonly
typeThe type of the item stack.
The world the item stack is in.
The components of the item stack type.
If the item stack is stackable.
The maximum stack size of the item stack.
The slot of the item stack in the container.
The slot of the item stack in the container.
Adds a dynamic property to the itemstack.
The key of the dynamic property.
The value of the dynamic property.
Decrements the amount of the item stack.
Optional
amount: numberThe amount to decrement.
Gets the specified component from the itemstack.
The component to get from the itemstack.
The component instance.
Gets the data entry for the item stack.
The data entry for the item stack.
Gets the specified dynamic property from the itemstack.
The key of the dynamic property.
The dynamic property if it exists, otherwise null
Gets the specified trait from the itemstack.
The trait to get from the itemstack
The trait if it exists, otherwise null
Checks if the itemstack has the specified component.
The component to check for.
Whether the itemstack has the component.
Checks if the itemstack has the specified dynamic property.
The key of the dynamic property.
Whether the itemstack has the dynamic property.
Whether the itemstack has the specified trait.
The trait to check for
Whether the itemstack has the trait
Increments the amount of the item stack.
Optional
amount: numberThe amount to increment.
Loads the data entry for the item stack.
The world to load the item stack in.
The item stack entry to load.
Whether to overwrite the existing data.
Removes the specified dynamic property from the itemstack.
The key of the dynamic property.
Removes the specified trait from the itemstack.
The trait to remove
Set the amount of the item stack.
The amount to set.
Set the block data for the item stack.
The block data to set.
Sets the specified dynamic property of the itemstack.
The key of the dynamic property.
The value of the dynamic property.
Start a cooldown for the item stack.
The duration of the cooldown in ticks.
Updates the item stack in the container.
Causes a player to use the item stack.
The player using the item.
The options for the item use.
Whether the item use was successful; default is true.
Static
emptyStatic
fromCreates an item stack from a data entry.
Optional
world: WorldThe world to create the item stack in.
The item stack.
Static
fromConverts a network item instance descriptor to an item stack.
The network item instance descriptor.
The item stack.
Static
toConverts the item stack to a network item instance descriptor. Which is used on the protocol level.
The item stack to convert.
The network item instance descriptor.
Static
toConverts the item stack to a network item stack descriptor. Which is used on the protocol level.
The item stack to convert.
The network item stack descriptor.
Create a new item stack instance.