ItemStack
¶
文档版本:1.21.60.21
ItemStack
类。script_api.minecraft/server.itemstack.description
属性¶
amount
amount
:int32
- script_api.minecraft/server.itemstack.amount.description
isStackable
isStackable
:boolean
- script_api.minecraft/server.itemstack.isstackable.description
keepOnDeath
keepOnDeath
:boolean
- script_api.minecraft/server.itemstack.keepondeath.description
lockMode
lockMode
:ItemLockMode
- script_api.minecraft/server.itemstack.lockmode.description
maxAmount
maxAmount
:int32
- script_api.minecraft/server.itemstack.maxamount.description
nameTag
nameTag
:string
|undefined
- script_api.minecraft/server.itemstack.nametag.description
type
type
:ItemType
- script_api.minecraft/server.itemstack.type.description
typeId
typeId
:string
- script_api.minecraft/server.itemstack.typeid.description
方法¶
constructor
script_api.minecraft/server.itemstack.constructor.description
itemType
:ItemType
|string
- script_api.minecraft/server.itemstack.constructor.itemtype.description
amount
:int32
=1
∈[1
,255
]- script_api.minecraft/server.itemstack.constructor.amount.description
- 返回值:
ItemStack
- script_api.minecraft/server.itemstack.constructor.return
getComponent
script_api.minecraft/server.itemstack.getcomponent.description
componentId
:string
- script_api.minecraft/server.itemstack.getcomponent.componentid.description
- 返回值:
ItemComponent
|undefined
- script_api.minecraft/server.itemstack.getcomponent.return
getComponents
script_api.minecraft/server.itemstack.getcomponents.description
- 返回值:
ItemComponent[]
- script_api.minecraft/server.itemstack.getcomponents.return
hasComponent
script_api.minecraft/server.itemstack.hascomponent.description
componentId
:string
- script_api.minecraft/server.itemstack.hascomponent.componentid.description
- 返回值:
boolean
- script_api.minecraft/server.itemstack.hascomponent.return
isStackableWith
script_api.minecraft/server.itemstack.isstackablewith.description
itemStack
:ItemStack
- script_api.minecraft/server.itemstack.isstackablewith.itemstack.description
- 返回值:
boolean
- script_api.minecraft/server.itemstack.isstackablewith.return