跳转至

Container

文档版本:1.21.0.24

Container类。script_api.minecraft/server.container.description

属性

emptySlotsCount
read-only emptySlotsCount: int32;
emptySlotsCountint32
script_api.minecraft/server.container.emptyslotscount.description
size
read-only size: int32;

方法

addItem

script_api.minecraft/server.container.additem.description

addItem(itemStack: ItemStack): ItemStack | undefined
clearAll

script_api.minecraft/server.container.clearall.description

clearAll(): void
返回值:void
script_api.minecraft/server.container.clearall.return
getItem

script_api.minecraft/server.container.getitem.description

getItem(slot: int32): ItemStack | undefined
isValid

script_api.minecraft/server.container.isvalid.description

isValid(): boolean
返回值:boolean
script_api.minecraft/server.container.isvalid.return
moveItem

script_api.minecraft/server.container.moveitem.description

moveItem(fromSlot: int32, toSlot: int32, toContainer: Container): void
setItem

script_api.minecraft/server.container.setitem.description

setItem(slot: int32, itemStack?: ItemStack): void
swapItems

script_api.minecraft/server.container.swapitems.description

swapItems(slot: int32, otherSlot: int32, otherContainer: Container): void
transferItem

script_api.minecraft/server.container.transferitem.description

transferItem(fromSlot: int32, toContainer: Container): ItemStack | undefined