Skip to content

Fluid Requirement

Frinn38 edited this page Jul 30, 2021 · 8 revisions

Fluid Requirement is used to define fluid inputs and outputs in a Custom Machine Recipe.

To use it you need to provide the registry name and the amount (in mB, with 1000mB being 1 Bucket of fluid) of the fluid you want the recipe to consume/produce.

This requirement is available in both input and output modes.

In input mode : When starting to craft the recipe, the machine will consume the desired amount of the specified fluid from the input tank it's in.

In output mode : When finishing to craft the recipe, the machine will produce the desired amount of the specified fluid and put it in the first disponible tank.

The Requirement type of Fluid Requirement is : "type": "custommachinery:fluid" Put this in the requirement json to define a Fluid requirement.

Properties

Beside the 2 common mandatory properties ("type" and "mode") the Fluid Requirement also have 2 other mandatory properties and 2 optional properties.

fluid (Mandatory)

Description : The registry name of the fluid you want to be consumed/produced by the recipe.
It must be specified like namespace:fluid_registry_name with "namespace" being either "minecraft" if the fluid is from vanilla (only "minecraft:water" and "minecraft:lava") or a mod ID if the fluid is from a mod (ex : "mekanism:steam").
If the requirement mode is input you can use a tag here using the # prefix like #minecraft:water. If the requirement mode is output you can't use a tag, only fluids are allowed !

Example : "fluid": "minecraft:lava" The fluid consumed/produced by the recipe will be vanilla lava.

Example with tag : "fluid": "#minecraft:water" The recipe will accept any fluid that are in the minecraft:water tag.

amount (Mandatory)

Description : An integer that define the amount of the specified fluid you want to be consumed/produced. It can be any positive number but remember that the machine need enough tank capacity to input/output the fluid.

Example : "amount": 1000 The recipe will consume/produce 1000mB of the specified fluid.

chance (Optional)

Description : A double between 0.0 and 1.0 that define the chance of the fluid to be consumed if input or produced if output, the chance is applied for the whole fluid amount defined in this requirement.

Default : 1.0 (The fluid will always be consumed/produced)

Example : "chance": 0.7 The fluid will have 70% chance to be consumed/produced.

tank (Optional)

Description : The tank id of a tank you want to force the player to put the fluid in. The tank id must be exactly the same as the one specified in the Fluid Component ID property or it will not work. If the requirement mode is "output" the produced fluid will be put in the specified tank.

Default : empty (The fluid can be put in any tank).

Example : "tank": "input1" The fluid will be input/output only in the tank with id input1.

Example

A Fluid Requirement that will make the Custom Machine Recipe produce 500mB of water with 50% chance :

{
    "type": "custommachinery:fluid",
    "mode": "output",
    "fluid": "minecraft:water",
    "amount": 500,
    "chance": 0.5
}
Clone this wiki locally