Skip to content

Energy Per Tick Requirement

Frinn38 edited this page May 12, 2021 · 3 revisions

Energy Per Tick Requirement is used to define per-tick energy inputs and outputs for a Custom Machine Recipe.

To use it you just need to provide the amount of energy (Forge Energy aka FE) you want the recipe to consume/produce each tick.

This requirement is available in both input and output modes.

In input mode : While crafting the recipe, the machine will consume the specified amount of energy each tick from the machine Energy Component.

In output mode : While crafting the recipe, the machine will produce the specified amount of energy each tick and put it in the machine Energy Component.

The Requirement type of Energy Per Tick Requirement is : "type": "custommachinery:energy_per_tick" Put this in the requirement json to define an Energy Per Tick Requirement.

Properties

Beside the 2 common mandatory properties ("type" and "mode") the Energy Per Tick Requirement only have 1 other mandatory property and 1 optional property.

Amount (Mandatory)

Description : An integer value that define the amount of energy the recipe will consume/produce each tick. It can be any positive number but remember that the machine Energy Component must be able to store at least this amount of energy.

Example : "amount": 1000 The recipe will consume/produce 1000FE per tick.

Chance (Optional)

Description : A double between 0.0 and 1.0 that define the chance of the energy to be consumed if input or produced if output, the chance is applied for the whole energy amount defined in this requirement. The chance will be applied each tick, meaning that an Energy Requirement with 0.5 chance will consume/produce it's energy amount every 2 ticks (depending of the randomness).

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

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

Example

An Energy Requirement that will make the recipe produce 2672FE per tick:

{
    "type": "custommachinery:energy_per_tick",
    "mode": "output",
    "amount": 2672
}

An Energy Requirement that will make the recipe consume 20FE per tick with 50% chance:

{
    "type": "custommachinery:energy_per_tick",
    "mode": "input",
    "amount": 20,
    "chance": 0.5
}
Clone this wiki locally