HomeCommandsExamplesGetting Started With ScriptsGlobal Keywords1.21 Migration Guide
BracketDumpersBracketHandlersBracketValidatorsResourceLocationBracketHandler

Fluid

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.Fluid;

Implements

Undocumented Interfaces

IFluidExtension

Operators

==(other as Fluid) as bool
Checks if this fluid is the same as another fluid.
script.zs
// (Fluid == (other as Fluid)) as bool
myFluid == myFluid

Parameters:

other Type: Fluid - The other fluid to check.

Return Type: bool

*(amount as int) as IFluidStack
Creates a new IFluidStack with the given amount of fluid.
script.zs
// (Fluid * (amount as int)) as IFluidStack
myFluid * myInt

Parameters:

amount Type: int

Return Type: IFluidStack

Members

Getter
Gets the bucket item for this fluid.
script.zs
// Fluid.bucket as ItemDefinition
myFluid.bucket

Return Type: ItemDefinition

bucket() as Item
Gets the bucket item for this fluid.

Returns: The bucket item for this fluid.

script.zs
// Fluid.bucket() as ItemDefinition;
myFluid.bucket();

Return Type: ItemDefinition

Getter
Gets the command string for this fluid.
script.zs
// Fluid.commandString as string
myFluid.commandString

Return Type: string

commandString() as string
Gets the command string for this fluid.

Returns: The command string for this fluid.

script.zs
// Fluid.commandString() as string;
myFluid.commandString();

Return Type: string

isIn(tag as KnownTag<Fluid>) as bool
Checks if this fluid is in the given tag.

Returns: True if this fluid is in the given tag, false otherwise.

script.zs
// Fluid.isIn(tag as KnownTag<Fluid>) as bool;
myFluid.isIn(myKnownTag);

Parameters:

tag Type: KnownTag<Fluid> - The tag to check.

Return Type: bool

isSame(other as Fluid) as bool
Checks if this fluid is the same as another fluid.

Returns: True if this fluid is the same as the other fluid, false otherwise.

script.zs
// Fluid.isSame(other as Fluid) as bool;
myFluid.isSame(myFluid);

Parameters:

other Type: Fluid - The other fluid to check.

Return Type: bool

makeStack(amount as int) as IFluidStack
Creates a new IFluidStack with the given amount of fluid.

Returns: a new (immutable) IFluidStack

script.zs
// Fluid.makeStack(amount as int) as IFluidStack;
myFluid.makeStack(1000);

Parameters:

amount Type: int

Return Type: IFluidStack

Getter
Gets the registry name of this fluid.
script.zs
// Fluid.registryName as ResourceLocation
myFluid.registryName

Return Type: ResourceLocation

registryName() as ResourceLocation
Gets the registry name of this fluid.

Returns: The registry name of this fluid.

script.zs
// Fluid.registryName() as ResourceLocation;
myFluid.registryName();

Return Type: ResourceLocation