The identifier or item type of the item stack.
Optionaloptions: Partial<ItemStackOptions>The options for the item stack.
The container the item stack is in. If the item stack is not in a container, this will be null.
ReadonlyidentifierThe identifier of the item stack.
Whether the item stack is stackable. If true, the item stack can be stacked with other item stacks of the same type.
The maximum stack size of the item stack. This is the maximum amount of items that can be stacked in a single item stack.
ReadonlynbtThe nbt data of the item stack.
ReadonlytypeThe type of the item stack.
The world the item stack is in.
The components of the item stack type.
Adds a trait to the itemstack.
The trait to add to the itemstack.
Optionaloptions: ConstructorParameters<K>[1]The additional options to pass to the trait.
The trait instance that was added to the itemstack.
Decrements the size of the item stack.
Optionalsize: numberThe size to decrement.
Get all dynamic properties of the item stack.
An array of all dynamic properties.
Get the auxiliary value of the item stack.
The auxiliary value of the item stack.
Gets the specified component from the itemstack.
The component to get from the itemstack.
The component instance.
Get a dynamic property from the item stack.
The key of the dynamic property.
The dynamic property value, or null if it does not exist.
Get the slot of the item stack in its container.
The slot of the item stack, or -1 if not in a container.
The amount of items in the item stack.
The size of the item stack.
Gets the specified trait from the itemstack.
The trait to get from the itemstack
The trait 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.
Check if the item stack has a dynamic property.
The key of the dynamic property.
Whether the item stack has the dynamic property.
Whether the itemstack has the specified trait.
The trait to check for
Whether the itemstack has the trait
Increments the size of the item stack.
Optionalsize: numberThe size to increment.
Remove a dynamic property from the item stack.
The key of the dynamic property.
Removes the specified trait from the itemstack.
The trait to remove
Set the auxiliary value of the item stack.
The auxiliary value to set.
Set a dynamic property on the item stack.
The key of the dynamic property.
The value of the dynamic property.
Set the slot of the item stack in its container.
The slot to set the item stack to.
The slot of the item stack, or -1 if not in a container.
Set the size of the item stack.
The size to set.
Start a cooldown for the item stack.
The duration of the cooldown in ticks.
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.
StaticemptyStaticfromStaticfromStaticfromConverts a network item instance descriptor to an item stack.
The network item instance descriptor.
Optionaloptions: Partial<ItemStackOptions>The item stack.
StatictoConverts 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.
StatictoConverts 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.