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 : "custommachinery:fluid".
Properties
The fluid requirement has 3 mandatory properties and 2 optional properties.
Mandatory properties
"type": "custommachinery:fluid"//Mandatory to define a fluid requirement.
Mode
Name : mode
Description :
Define the I/O mode of the requirement.
input The requirement will consume fluid at the start of the crafting process.
output The requirement will produce fluid at the end of the crafting process.
Example :
"mode": "input"
The requirement will consume fluid at the start of the crafting process.
"item" property is the registry name of the fluid you want to be consumed/produced by the recipe.
It must be specified like namespace:item_registry_name with "namespace" being either "minecraft" if the item is from vanilla or a mod ID if the item is from a mod (ex : minecraft:diamond or mekanism:steam).
If the requirement mode is input you can use a tag instead, by using "tag" instead of "item". Example : "tag": "tag_id"
You can't use a tag if the requirement mode is output !
The recipe will accept any fluid that are in the minecraft:water tag.
Optional properties
Chance
Name : chance
Description :
A double between 0.0 and 1.0 that define the chance of the requirement to be processed.
Default : 1
The requirement will always be processed.
Example :
"chance": 0.7
The requirement will have 70% chance to be processed.
Tank
Name : tank
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 :