ItemStack
¶
文档版本:1.21.60.21
ItemStack
类。script_api.mojang-minecraft.itemstack.description
属性¶
amount
amount
:int32
- script_api.mojang-minecraft.itemstack.amount.description
data
data
:int32
- script_api.mojang-minecraft.itemstack.data.description
id
id
:string
- script_api.mojang-minecraft.itemstack.id.description
nameTag
nameTag
:string
|undefined
- script_api.mojang-minecraft.itemstack.nametag.description
方法¶
constructor
script_api.mojang-minecraft.itemstack.constructor.description
itemType
:ItemType
|string
- script_api.mojang-minecraft.itemstack.constructor.itemtype.description
amount
:int32
=1
∈[0
,255
]- script_api.mojang-minecraft.itemstack.constructor.amount.description
data
:int32
=0
∈[0
,32767
]- script_api.mojang-minecraft.itemstack.constructor.data.description
- 返回值:
ItemStack
- script_api.mojang-minecraft.itemstack.constructor.return
getComponent
script_api.mojang-minecraft.itemstack.getcomponent.description
componentId
:string
- script_api.mojang-minecraft.itemstack.getcomponent.componentid.description
- 返回值:
ItemComponent
|undefined
- script_api.mojang-minecraft.itemstack.getcomponent.return
getComponents
script_api.mojang-minecraft.itemstack.getcomponents.description
- 返回值:
ItemComponent[]
- script_api.mojang-minecraft.itemstack.getcomponents.return
getLore
script_api.mojang-minecraft.itemstack.getlore.description
- 返回值:
string[]
- script_api.mojang-minecraft.itemstack.getlore.return
hasComponent
script_api.mojang-minecraft.itemstack.hascomponent.description
componentId
:string
- script_api.mojang-minecraft.itemstack.hascomponent.componentid.description
- 返回值:
boolean
- script_api.mojang-minecraft.itemstack.hascomponent.return
setLore
script_api.mojang-minecraft.itemstack.setlore.description
loreList
?:string[]
=null
- script_api.mojang-minecraft.itemstack.setlore.lorelist.description
- 返回值:
void
- script_api.mojang-minecraft.itemstack.setlore.return