跳转至

ItemStack

文档版本:1.21.0.24

ItemStack类。script_api.minecraft/server.itemstack.description

属性

amount
read-only amount: int32;
isStackable
read-only isStackable: boolean;
isStackableboolean
script_api.minecraft/server.itemstack.isstackable.description
keepOnDeath
read-only keepOnDeath: boolean;
keepOnDeathboolean
script_api.minecraft/server.itemstack.keepondeath.description
lockMode
read-only lockMode: ItemLockMode;
maxAmount
read-only maxAmount: int32;
nameTag
read-only nameTag: string | undefined;
nameTagstring|undefined
script_api.minecraft/server.itemstack.nametag.description
type
read-only type: ItemType;
typeId
read-only typeId: string;

方法

constructor

script_api.minecraft/server.itemstack.constructor.description

new constructor(itemType: ItemType | string, amount: int32): ItemStack
getComponent

script_api.minecraft/server.itemstack.getcomponent.description

getComponent(componentId: string): ItemComponent | undefined
getComponents

script_api.minecraft/server.itemstack.getcomponents.description

getComponents(): ItemComponent[]
getLore

script_api.minecraft/server.itemstack.getlore.description

getLore(): string[]
返回值:string[]
script_api.minecraft/server.itemstack.getlore.return
hasComponent

script_api.minecraft/server.itemstack.hascomponent.description

hasComponent(componentId: string): boolean
isStackableWith

script_api.minecraft/server.itemstack.isstackablewith.description

isStackableWith(itemStack: ItemStack): boolean
setLore

script_api.minecraft/server.itemstack.setlore.description

setLore(loreList?: string[]): void
loreList?:string[]null
script_api.minecraft/server.itemstack.setlore.lorelist.description
返回值:void
script_api.minecraft/server.itemstack.setlore.return