# Energy per tick

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 :`"custommachinery:energy_per_tick"`

### Properties

The energy per tick requirement have 3 mandatory properties and 1 optional property.

#### Mandatory properties

```json
"type": "custommachinery:energy_per_tick" //Mandatory to define an energy per tick requirement.
```

<details>

<summary>Mode</summary>

#### Name : `mode`

#### Description :

Define the I/O mode of the requirement.

* `input` The requirement will consume energy at the start of the crafting process.
* `output` The requirement will produce energy at the end of the crafting process.

#### Example :

```json
"mode": "input"
```

The requirement will consume energy at the start of the crafting process.

</details>

<details>

<summary>Amount</summary>

#### Name : `amount`

#### Description :&#x20;

A positive integer value that define the amount of energy the recipe will consume/produce.&#x20;

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 :&#x20;

```json
"amount": 1000
```

The recipe will consume/produce 1000FE.

</details>

#### Optional property

<details>

<summary>Chance</summary>

#### 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 :

```json
"chance": 0.7
```

The requirement will have 70% chance to be processed.

</details>

### Example

An energy per tick requirement that will make the recipe produce 2672FE per tick:

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

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

```json
{
    "type": "custommachinery:energy_per_tick",
    "mode": "input",
    "amount": 20,
    "chance": 0.5
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://frinn.gitbook.io/custom-machinery-1.16/recipes/requirements/energy-per-tick.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
