IFluidStack

Importing the class

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;

Implemented Interfaces

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

Casters

Result typeIs Implicit
FluidIngredienttrue
MCFluidotrue

Methods

asImmutable

Return Type: IFluidStack

ZenScript
Copy
// IFluidStack.asImmutable() as IFluidStack

myIFluidStack.asImmutable();
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
ParameterTypeDescription
otherIFluidStackother IFluidStack to compare against
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();
getTag

Returns the NBT tag attached to this FluidStack.

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

ZenScript
Copy
// IFluidStack.getTag() as IData

myIFluidStack.getTag();
isImmutable

Return Type: boolean

ZenScript
Copy
// IFluidStack.isImmutable() as boolean

myIFluidStack.isImmutable();
mutable

Makes this stack mutable

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

ZenScript
Copy
// IFluidStack.mutable() as IFluidStack

myIFluidStack.mutable();
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);
ParameterTypeDescription
amountintThe amount to multiply this stack
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"]}});
ParameterTypeDescription
tagIDataThe tag to set.

Operadores

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
MUL

Sets the fluid amount in MilliBuckets (MB)

ZenScript
Copy
myIFluidStack * amount as int
myIFluidStack * 1000
OR
ZenScript
Copy
myIFluidStack | other as FluidIngredient

Properties

NombreTypeHas GetterHas SetterDescription
amountinttruefalseGets the fluid amount in MilliBuckets (mB).
commandStringstringtruefalseReturns the BEP to get this thingy
emptybooleantruefalseGets whether or not this fluid stack is empty.
fluidMCFluidotruefalseRetrieves this fluid stack's fluid.
hasTagbooleantruefalseReturns true if this FluidStack has a Tag
isImmutablebooleantruefalseNo Description Provided
registryNameUbicaciĆ³n MCResourcetruefalseGets the registry name for the fluid this stack is representing.
tagIDatatruefalseReturns the NBT tag attached to this FluidStack.