实验性
实验性
amount表示物品堆中的物品数量。有效值的范围是1-255。提供的值会被限制在物品的最大堆叠数量内。
Number 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.
无法在只读模式下修改此属性,详见 WorldBeforeEvents。
只读
实验性
is只读
实验性
is实验性
keep获取或设置物品在死亡时是否保留。
Gets or sets whether the item is kept on death.
无法在只读模式下修改此属性,详见 WorldBeforeEvents。
实验性
lock获取或设置物品的锁定模式。默认值是ItemLockMode.none
。
Gets or sets the item's lock mode. The default value is
ItemLockMode.none
.
无法在只读模式下修改此属性,详见 WorldBeforeEvents。
只读
实验性
max可选
实验性
name表示此物品堆的自定义名称。悬停在物品上时会显示名称标签。将名称标签设置为空字符串或undefined
将移除名称标签。
Given 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.
无法在只读模式下修改此属性,详见 WorldBeforeEvents。
只读
实验性
type只读
实验性
type实验性
返回当前存储在此实体上的所有动态属性的总大小(以字节为单位)。这包括键和值的大小。这对于诊断性能警告信号很有用——例如,若一个实体有许多兆字节的关联动态属性,可能会在各种设备上加载缓慢。
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.
实验性
被比较的物品堆。
The ItemStack that is being compared.
返回此物品堆是否可以与给定的itemStack
堆叠。
Returns whether this item stack can be stacked with the
given itemStack
.
返回此物品堆是否可以与给定的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.
实验性
可选
blockIdentifiers: string[]方块标识符列表。
The list of blocks, given by their identifiers.
表示此物品在冒险模式下可以破坏的方块类型列表。方块名称显示在物品的提示信息中。将值设置为undefined
将清除列表。
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.
无法在只读模式下调用此函数,详见 WorldBeforeEvents。
实验性
可选
blockIdentifiers: string[]方块标识符列表。
The list of blocks, given by their identifiers.
表示此物品在冒险模式下可以放置的方块类型列表。仅适用于方块物品。方块名称显示在物品的提示信息中。将值设置为undefined
将清除列表。
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.
无法在只读模式下调用此函数,详见 WorldBeforeEvents。
实验性
可选
itemStack: ItemStack要放入槽位的ItemStack。
The ItemStack to be placed in the slot.
将给定的ItemStack放入槽位,替换任何现有的物品。
Sets the given ItemStack in the slot, replacing any existing item.
无法在只读模式下调用此函数,详见 WorldBeforeEvents。
实验性
可选
loreList: string[]附加文本信息的列表。将此参数设置为undefined
将清除附加文本信息。
A list of lore strings. Setting this argument to undefined will clear the lore.
设置物品堆的附加文本信息(次要显示字符串)。
Sets the lore value - a secondary display string - for an ItemStack.
无法在只读模式下调用此函数,详见 WorldBeforeEvents。
表示更大容器中的一个槽位(例如,实体的物品栏)。
Represents a slot within a broader container (e.g., entity inventory.)