Skip to content

Energy Requirement

Frinn38 edited this page May 12, 2021 · 4 revisions

Energy Requirement is used to define 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.

This requirement is available in both input and output modes.

In input mode : When starting to craft the recipe, the machine will consume the specified amount of energy from the machine Energy Component.

In output mode : When starting to craft the recipe, the machine will produce the specified amount of energy and put it in the machine Energy Component.

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

Properties

Beside the 2 common mandatory properties ("type" and "mode") the Energy 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. 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.

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.

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:

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

An Energy Requirement that will make the recipe consume 100FE with 80% chance:

{
    "type": "custommachinery:energy",
    "mode": "input",
    "amount": 100,
    "chance": 0.8
}
Clone this wiki locally