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.fluid.IFluidStack;

已实现的接口

Link to 已实现的接口

IFluidStack implements the following interfaces. That means all methods defined in these interfaces are also available in IFluidStack

Result Type是否隐藏
Result Type
Fluid
是否隐藏
true
Result Type
FluidIngredient
是否隐藏
true
Result Type
IData #数据
是否隐藏
true

Name: asIData

Return Type: IData

ZenScript
Copy
// IFluidStack.asIData() as IData

myIFluidStack.asIData();

Name: asImmutable

Return Type: IFluidStack

ZenScript
Copy
// IFluidStack.asImmutable() as IFluidStack

myIFluidStack.asImmutable();

Name: containsOther

Checks if this IFluidStack, contains the given IFluidStack by checking if the fluids are the same, and if this fluid's amount is bigger than the given fluid's amount

Returns: true if this fluid contains the other fluid
Return Type: boolean

ZenScript
Copy
IFluidStack.containsOther(other as IFluidStack) as boolean
参数类型描述
参数
other
类型
IFluidStack
描述
other IFluidStack to compare against

Name: copy

Copies the stack. Only needed when mutable stacks are involved.

Returns: A new stack, that contains the same info as this one
Return Type: IFluidStack

ZenScript
Copy
// IFluidStack.copy() as IFluidStack

myIFluidStack.copy();

Link to getCommandString

Name: getCommandString

Returns the BEP to get this thingy

Return Type: string

ZenScript
Copy
// IFluidStack.getCommandString() as string

myIFluidStack.getCommandString();

Name: getTag

Returns the NBT tag attached to this FluidStack.

Returns: MapData of the FluidStack's NBT Tag, null if it doesn't exist.
Return Type: IData

ZenScript
Copy
// IFluidStack.getTag() as IData

myIFluidStack.getTag();

Name: isImmutable

Return Type: boolean

ZenScript
Copy
// IFluidStack.isImmutable() as boolean

myIFluidStack.isImmutable();

Name: mutable

Makes this stack mutable

Returns: A new Stack, that is mutable.
Return Type: IFluidStack

ZenScript
Copy
// IFluidStack.mutable() as IFluidStack

myIFluidStack.mutable();

Name: setAmount

Sets the fluid amount in MilliBuckets (mB)

Returns: A new stack, or this stack, depending if this stack is mutable
Return Type: IFluidStack

ZenScript
Copy
// IFluidStack.setAmount(amount as int) as IFluidStack

myIFluidStack.setAmount(1000);
参数类型描述
参数
amount
类型
int
描述
The amount to multiply this stack

Name: withTag

Sets the tag for the FluidStack.

Returns: This FluidStack if it is mutable, a new one with the changed property otherwise
Return Type: IFluidStack

ZenScript
Copy
// IFluidStack.withTag(tag as IData?) as IFluidStack

myIFluidStack.withTag({Display: {lore: ["Hello"]}});
参数类型描述
参数
tag #标签
类型
IData?
描述
The tag to set.

Name: CONTAINS

Checks if this IFluidStack, contains the given IFluidStack by checking if the fluids are the same, and if this fluid's amount is bigger than the given fluid's amount

ZenScript
Copy
other as IFluidStack in myIFluidStack

Name: MUL

Sets the fluid amount in MilliBuckets (MB)

ZenScript
Copy
myIFluidStack * amount as int
myIFluidStack * 1000

Name: OR

ZenScript
Copy
myIFluidStack | other as FluidIngredient
名称类型可获得可设置描述
名称
amount
类型
int
可获得
true
可设置
false
描述
Gets the fluid amount in MilliBuckets (mB).
名称
commandString #命令字符串
类型
string
可获得
true
可设置
false
描述
Returns the BEP to get this thingy
名称
empty
类型
布尔值
可获得
true
可设置
false
描述
Gets whether or not this fluid stack is empty.
名称
fluid
类型
Fluid
可获得
true
可设置
false
描述
Retrieves this fluid stack's fluid.
名称
hasTag
类型
布尔值
可获得
true
可设置
false
描述
Returns true if this FluidStack has a Tag
名称
isImmutable
类型
布尔值
可获得
true
可设置
false
描述
名称
registryName
类型
资源位置
可获得
true
可设置
false
描述
Gets the registry name for the fluid this stack is representing.
名称
tag #标签
类型
IData #数据
可获得
true
可设置
false
描述
Returns the NBT tag attached to this FluidStack.