Modifiers
Make a machine upgrade able to alter a recipe requirement.
Requirement modifiers are used to tweak some properties of a recipe requirement.
They are defined in json inside of the modifiers property of the machine upgrade item json.
List of properties that can be modified
Speed
-
The recipe's time property
Function
"chance"
chance
Properties
The requirement modifier has 4 mandatory properties and 2 optional property.
Mandatory properties
Requirement
Name : requirement
requirementDescription :
The type of the requirement you want to apply the modifier to. This is the same type as the one you specify in the type property when defining the requirement in the recipe json.
Example :
This modifier will be applied to the energy requirement.
Note :
The recipe duration can also be modified with this system.
Use custommachinery:speed to target it.
Warning : Using this as a requirement will alter the recipe process duration, which is the opposite of the speed (the lower the duration the faster the speed).
Operation
Name : operation
operationDescription :
The mathematical operation that will be applied to the targeted requirement property by the modifier. The available operations are :
addition: The resulting value will be the sum of the base requirement value and the modifier value.multiplication: The resulting value will be the multiplication of the base requirement value and the modifier value.
Example :
The base requirement value (defined in the recipe) will be multiplicated by the value defined in this modifier.
Optional properties
Target
Name : target
targetDescription :
Some requirement have more than one value that can be modified.
In that case the target property can be used to define which one of the requirement property you want to modify.
For example some requirement have a chance property that can be modified by the upgrade, simply use "target": "chance" to target the chance property instead of the default one.
Default : empty
empty The modifier will be applied to the default property of the defined requirement.
Example :
In case of the Entity Requirement the default property is amount so if you want to modify the radius property you can do :
Chance
Name : chance
chanceDescription :
The chance the modifier will be applied to the requirement, this have nothing to do with the chance property some requirement have and will be applied independently.
This value must be between 0 and 1 where 0 is 0% chance to be applied and 1 is 100% chance.
Default : 1
The modifier have 100% chance to be applied on the requirement.
Example :
The modifier have 40% chance to be applied on the requirement.
Example
A modifier that half the time needed to process a recipe :
A modifier that double the energy per tick consumed by a recipe :
A modifier that has 50% chance to add 1 item produced by a recipe :
Last updated