It might be required for you to import the package if you encounter any issues (like casting an Array), so better be safe than sorry and add the import at the very top of the file.

ZenScript
Copy
import crafttweaker.api.capability.IItemHandler;

Name: extractItem

Return Type: IItemStack

ZenScript
Copy
IItemHandler.extractItem(slot as int, amount as int, simulate as boolean) as IItemStack
参数类型描述可选DefaultValue
参数
slot
类型
int
描述
No Description Provided
可选
false
DefaultValue
参数
amount
类型
int
描述
No Description Provided
可选
false
DefaultValue
参数
simulate
类型
布尔值
描述
No Description Provided
可选
true
DefaultValue
false

Name: getSlotLimit

Return Type: int

ZenScript
Copy
IItemHandler.getSlotLimit(slot as int) as int
参数类型描述
参数
slot
类型
int
描述
No Description Provided

Name: getSlots

Return Type: int

ZenScript
Copy
// IItemHandler.getSlots() as int

myIItemHandler.getSlots();

Name: getStackInSlot

Return Type: IItemStack

ZenScript
Copy
IItemHandler.getStackInSlot(slot as int) as IItemStack
参数类型描述
参数
slot
类型
int
描述
No Description Provided

Name: insertItem

Return Type: IItemStack

ZenScript
Copy
IItemHandler.insertItem(slot as int, stack as IItemStack, simulate as boolean) as IItemStack
参数类型描述可选DefaultValue
参数
slot
类型
int
描述
No Description Provided
可选
false
DefaultValue
参数
堆叠
类型
IItemstack
描述
No Description Provided
可选
false
DefaultValue
参数
simulate
类型
布尔值
描述
No Description Provided
可选
true
DefaultValue
false

Name: isItemValid

Return Type: boolean

ZenScript
Copy
IItemHandler.isItemValid(slot as int, stack as IItemStack) as boolean
参数类型描述
参数
slot
类型
int
描述
No Description Provided
参数
堆叠
类型
IItemstack
描述
No Description Provided
名称类型可获得可设置描述
名称
slots
类型
int
可获得
true
可设置
false
描述
No Description Provided