Private
constructorNumber of the items in the stack. Valid values range between 1-255. The provided value will be clamped to the item's maximum stack size.
This property can't be edited in read-only mode.
This property can't be read in early-execution mode.
Readonly
isReturns whether the item is stackable. An item is considered stackable if the item's maximum stack size is greater than 1 and the item does not contain any custom data or properties.
This property can't be read in early-execution mode.
Readonly
isReturns whether the ContainerSlot is valid. The container slot is valid if the container exists and is loaded, and the slot index is valid.
This property can't be read in early-execution mode.
This property can't be edited in read-only mode.
This property can't be read in early-execution mode.
This property can't be edited in read-only mode.
This property can't be read in early-execution mode.
Readonly
maxThe maximum stack size. This value varies depending on the type of item. For example, torches have a maximum stack size of 64, while eggs have a maximum stack size of 16.
This property can't be read in early-execution mode.
Optional
nameGiven name of this stack of items. The name tag is displayed
when hovering over the item. Setting the name tag to an
empty string or undefined
will remove the name tag.
This property can't be edited in read-only mode.
This property can't be read in early-execution mode.
Readonly
typeThis property can't be read in early-execution mode.
Readonly
typeIdentifier of the type of items for the stack. If a namespace is not specified, 'minecraft:' is assumed. Examples include 'wheat' or 'apple'.
This property can't be read in early-execution mode.
This function can't be called in early-execution mode.
This function can't be called in early-execution mode.
This function can't be called in early-execution mode.
The property identifier.
Returns the value for the property, or undefined if the property has not been set.
This function can't be called in early-execution mode.
A string array of the dynamic properties set on this entity.
Returns the available set of dynamic property identifiers that have been used on this item stack.
This function can't be called in early-execution mode.
Returns the total size, in bytes, of all the dynamic properties that are currently stored for this entity. This includes the size of both the key and the value. This can be useful for diagnosing performance warning signs - if, for example, an entity has many megabytes of associated dynamic properties, it may be slow to load on various devices.
This function can't be called in early-execution mode.
Returns a copy of the item in the slot. Returns undefined if the slot is empty.
This function can't be called in early-execution mode.
An array of lore strings. If the item does not have lore, returns an empty array.
This function can't be called in early-execution mode.
An array of lore lines. If the item does not have lore, returns an empty array.
Returns the lore value - a secondary display string - for an ItemStack. String lore lines will be converted to a RawMessage and put under RawMessage.text.
This function can't be called in early-execution mode.
Returns all tags for the item in the slot. Return an empty array if the the slot is empty.
This function can't be called in early-execution mode.
This function can't be called in early-execution mode.
The item tag.
Returns false when the slot is empty or the item in the slot does not have the given tag.
This function can't be called in early-execution mode.
The ItemStack that is being compared.
Returns whether this item stack can be stacked with the
given itemStack
.
Returns whether this item stack can be stacked with the
given itemStack
. This is determined by comparing the item
type and any custom data and properties associated with the
item stacks. The amount of each item stack is not taken into
consideration.
This function can't be called in early-execution mode.
Optional
blockIdentifiers: string[]The list of blocks, given by their identifiers.
The list of block types this item can break in Adventure mode. The block names are displayed in the item's tooltip. Setting the value to undefined will clear the list.
This function can't be called in read-only mode.
Throws if the slot's container is invalid. Also throws if any of the provided block identifiers are invalid.
Error
This function can't be called in early-execution mode.
Optional
blockIdentifiers: string[]The list of blocks, given by their identifiers.
The list of block types this item can be placed on in Adventure mode. This is only applicable to block items. The block names are displayed in the item's tooltip. Setting the value to undefined will clear the list.
This function can't be called in read-only mode.
Throws if the slot's container is invalid. Also throws if any of the provided block identifiers are invalid.
Error
This function can't be called in early-execution mode.
The property identifier.
Optional
value: string | number | boolean | Vector3Data value of the property to set.
Throws if the slot's container is invalid.
minecraftcommon.ArgumentOutOfBoundsError
minecraftcommon.UnsupportedFunctionalityError
This function can't be called in early-execution mode.
Optional
itemStack: ItemStackThe ItemStack to be placed in the slot.
This function can't be called in read-only mode.
This function can't be called in early-execution mode.
Optional
loreList: (string | RawMessage)[]A list of lore strings. Setting this argument to undefined will clear the lore.
This function can't be called in read-only mode.
This function can't be called in early-execution mode.
Represents a slot within a broader container (e.g., entity inventory.)
Example: getMainhandSlotFromEquippble.js
Example: getMainhandSlotFromInventory.js