Home Migration Guide Getting Started With Scripts Commands Examples
Generic JSON Recipes

FluidStackIngredient

This class was added by a mod with mod-id mekanism. So you need to have this mod installed if you want to use this feature.

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.

script.zs
import mods.mekanism.api.ingredient.FluidStackIngredient;

Static Methods

Combines multiple FluidStackIngredients into a single FluidStackIngredient.

Returns: A single FluidStackIngredient representing all the passed in ingredients.
Return Type: FluidStackIngredient

script.zs
FluidStackIngredient.createMulti(ingredients as FluidStackIngredient[]) as FluidStackIngredient
ParameterTypeDescription
Parameter
ingredients
Type
FluidStackIngredient[]
Description
Ingredients to combine

Creates a FluidStackIngredient that matches a given fluid tag with amount.

Returns: A FluidStackIngredient that matches a given fluid tag with amount.
Return Type: FluidStackIngredient

script.zs
FluidStackIngredient.from(fluidTag as MCTagWithAmount<MCFluid>) as FluidStackIngredient
ParameterTypeDescription
Parameter
fluidTag
Type
MCTagWithAmount<MCFluid>
Description
Tag and amount to match

Creates a FluidStackIngredient that matches a given fluid stack.

Returns: A FluidStackIngredient that matches a given fluid stack.
Return Type: FluidStackIngredient

script.zs
FluidStackIngredient.from(instance as IFluidStack) as FluidStackIngredient
ParameterTypeDescription
Parameter
instance
Type
IFluidStack
Description
Fluid stack to match

Creates a FluidStackIngredient that matches a given fluid and amount.

Returns: A FluidStackIngredient that matches a given fluid and amount.
Return Type: FluidStackIngredient

script.zs
FluidStackIngredient.from(fluid as MCFluid, amount as int) as FluidStackIngredient
ParameterTypeDescription
Parameter
fluid
Type
MCFluid
Description
Fluid to match
Parameter
amount
Type
int
Description
Amount needed

Creates a FluidStackIngredient that matches a given fluid tag with a given amount.

Returns: A FluidStackIngredient that matches a given fluid tag with a given amount.
Return Type: FluidStackIngredient

script.zs
FluidStackIngredient.from(fluidTag as MCTag<MCFluid>, amount as int) as FluidStackIngredient
ParameterTypeDescription
Parameter
fluidTag
Type
MCTag<MCFluid>
Description
Tag to match
Parameter
amount
Type
int
Description
Amount needed

Casters

Result typeIs Implicit
Result type
IData
Is Implicit
true

Methods

Converts this FluidStackIngredient into JSON (IData).

Returns: FluidStackIngredient as JSON.
Return Type: IData

script.zs
// FluidStackIngredient.asIData() as IData
myFluidStackIngredient.asIData();

OR’s this FluidStackIngredient with another FluidStackIngredient to create a multi FluidStackIngredient

Returns: Multi FluidStackIngredient that matches both the source FluidStackIngredient and the OR’d FluidStackIngredient.
Return Type: FluidStackIngredient

script.zs
FluidStackIngredient.or(other as FluidStackIngredient) as FluidStackIngredient
ParameterTypeDescription
Parameter
other
Type
FluidStackIngredient
Description
FluidStackIngredient to combine with.

Operators

Returns a new FluidStackIngredient using the two FluidStackIngredient as a base.

script.zs
(ing1 as FluidStackIngredient) | (ing2 as FluidStackIngredient);