Home Commands Examples Getting Started With Scripts Global Keywords
BracketDumpers BracketHandlers BracketValidators ResourceLocationBracketHandler

IFluidStack

Importing the class

If you need to reference this type directly, like when casting an Array, or as a parameter, you will need to import it. Simply add the import at the top of the file.

script.zs
import crafttweaker.api.fluid.IFluidStack;

Implements

IFluidStack implements the following interfaces:

CommandStringDisplayable

Operators

|(other as CTFluidIngredient) as CTFluidIngredient
script.zs
// (IFluidStack | (other as CTFluidIngredient)) as CTFluidIngredient
myIFluidStack | myCTFluidIngredient

Parameters:

Return Type: FluidIngredient

in(other as IFluidStack) as bool
Checks if this IFluidStack, matches 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
script.zs
// ((other as IFluidStack) in IFluidStack) as bool
myIFluidStack in myIFluidStack

Parameters:

other Type: IFluidStack - other IFluidStack to compare against

Return Type: bool

*(amount as int) as IFluidStack
Sets the fluid amount in MilliBuckets (mB)
script.zs
// (IFluidStack * (amount as int)) as IFluidStack
myIFluidStack * myInt

Parameters:

amount Type: int - The amount to multiply this stack

Return Type: IFluidStack

Members

Getter
Gets the fluid amount in MilliBuckets (mB).
script.zs
// IFluidStack.amount as long
myIFluidStack.amount

Return Type: long

implicit as CTFluidIngredient
script.zs
// IFluidStack as CTFluidIngredient
myIFluidStack as CTFluidIngredient

Return Type: FluidIngredient

asIData() as IData
script.zs
// IFluidStack.asIData() as IData;
myIFluidStack.asIData();

Return Type: IData

implicit as IData
script.zs
// IFluidStack as IData
myIFluidStack as IData

Return Type: IData

asImmutable() as IFluidStack
script.zs
// IFluidStack.asImmutable() as IFluidStack;
myIFluidStack.asImmutable();

Return Type: IFluidStack

asMutable() as IFluidStack
Makes this stack mutable

Returns: A new Stack, that is mutable.

script.zs
// IFluidStack.asMutable() as IFluidStack;
myIFluidStack.asMutable();

Return Type: IFluidStack

copy() as IFluidStack
Copies the stack. Only needed when mutable stacks are involved.

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

script.zs
// IFluidStack.copy() as IFluidStack;
myIFluidStack.copy();

Return Type: IFluidStack

Getter
Gets whether this fluid stack is empty.
script.zs
// IFluidStack.empty as bool
myIFluidStack.empty

Return Type: bool

static empty() as IFluidStack
Gets the empty IFluidStack

Returns: The empty IFluidStack

script.zs
// IFluidStack.empty() as IFluidStack;
IFluidStack.empty();

Return Type: IFluidStack

Getter
Retrieves this fluid stack's fluid.
script.zs
// IFluidStack.fluid as Fluid
myIFluidStack.fluid

Return Type: Fluid

implicit as Fluid
Retrieves this fluid stack's fluid.
script.zs
// IFluidStack as Fluid
myIFluidStack as Fluid

Return Type: Fluid

Getter
Returns true if this FluidStack has a Tag
script.zs
// IFluidStack.hasTag as bool
myIFluidStack.hasTag

Return Type: bool

Getter
script.zs
// IFluidStack.isImmutable as bool
myIFluidStack.isImmutable

Return Type: bool

isImmutable() as bool
script.zs
// IFluidStack.isImmutable() as bool;
myIFluidStack.isImmutable();

Return Type: bool

matches(other as IFluidStack) as bool
Checks if this IFluidStack, matches 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

script.zs
// IFluidStack.matches(other as IFluidStack) as bool;
myIFluidStack.matches(myIFluidStack);

Parameters:

other Type: IFluidStack - other IFluidStack to compare against

Return Type: bool

Getter
Gets the registry name for the fluid this stack is representing.
script.zs
// IFluidStack.registryName as ResourceLocation
myIFluidStack.registryName

Return Type: ResourceLocation

setAmount(amount as int) as IFluidStack
Sets the fluid amount in MilliBuckets (mB)

Returns: A new stack, or this stack, depending on if this stack is mutable

script.zs
// IFluidStack.setAmount(amount as int) as IFluidStack;
myIFluidStack.setAmount(1000);

Parameters:

amount Type: int - The amount to multiply this stack

Return Type: IFluidStack

Getter
Returns the NBT tag attached to this FluidStack.
script.zs
// IFluidStack.tag as IData
myIFluidStack.tag

Return Type: IData

tag() as IData
Returns the NBT tag attached to this FluidStack.

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

script.zs
// IFluidStack.tag() as IData;
myIFluidStack.tag();

Return Type: IData

withTag(tag as IData) as IFluidStack
Sets the tag for the FluidStack.

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

script.zs
// IFluidStack.withTag(tag as IData) as IFluidStack;
myIFluidStack.withTag({Display: {lore: ["Hello"]}});

Parameters:

tag Type: IData - The tag to set.

Return Type: IFluidStack