Chemical requirement is used to define Mekanism chemicals 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 the chemical 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 chemical 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 chemical and put it in the first disponible tank.
If the requirement is _per_tick the specified amount will be consumed/produced each tick instead of once.
All of Mekanism chemicals types are supported :
Gas
Infusion
Pigment
Slurry
The type of chemical requirement is : "custommachinery:chemical".
Properties
The chemical requirements has 4 mandatory properties and 2 optional properties.
Mandatory properties
"type": "custommachinery:chemical"//Mandatory to define a chemical requirement.OR"type": "custommachinery:chemical_per_tick"//Mandatory to define a chemical per tick requirement.
Mode
Name : mode
Description :
Define the I/O mode of the requirement.
input The requirement will consume the specified amount of the specified chemical.
output The requirement will produce the specified amount of the specified chemical.
Example :
"mode": "input"
Chemical
Name : chemical
Description :
The registry name of the chemical you want to be consumed/produced by the recipe.
It must be specified like namespace:registry_name with "namespace" being either "mekanism" if the fluid is from Mekanism or another mod ID if the chemical is from an addon.
Example :
"chemical": "mekanism:sulfuric_acid"
The chemical consumed/produced by the recipe will be Mekanism sulfuric acid (gas).
Amount
Name : amount
Description :
A positive integer that define the amount of the specified chemical 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 chemical.
Example :
"amount": 1000
The recipe will consume/produce 1000mB of the specified chemical.
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 chemical in. The tank id must be exactly the same as the one specified in the Chemical Component ID property or it will not work. If the requirement mode is "output" the produced chemical will be put in the specified tank.
Default : empty
The chemical can be put in any tank.
Example :
"tank": "input1"
The chemical will be input/output only in the tank with id input1.
Example
A chemical requirement that will make the custom machine recipe produce 500mB of Mekanism sulfuric acid with 50% chance :