# Heat (Mekanism)

{% hint style="warning" %}
This requirement requires [Custom Machinery Mekanism](https://www.curseforge.com/minecraft/mc-mods/custom-machinery-mekanism) to be installed.
{% endhint %}

The heat requirement (and also heat\_per\_tick requirement) can be used in a recipe to consume or produce mekanism heat.

The requirement will directly interact with the machine's [heat component](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/heat-component-mekanism), if the machine does not have a heat component then the requirement won't work.

This requirement is available in both modes :&#x20;

* Input : consume heat, decrease machine temperature.
* Output : produce heat, increase machine temperature.

This requirement can either consume/produce heat once with \
`"type": "custommachinery:heat"` \
or each tick of the recipe with \
`"type": "custommachinery:heat_per_tick"`.

### Properties

The heat requirement has 3 mandatory properties and 2 optional properties.

#### Mandatory properties

```json
"type": "custommachinery:heat" //Mandatory to define a heat requirement.
OR
"type": "custommachinery:heat_per_tick" //Mandatory to define a heat per tick requirement.
```

<details>

<summary>Mode</summary>

#### Name : `mode`

#### Description :

Define the I/O mode of the requirement.

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

#### Example :

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

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

</details>

<details>

<summary>Amount</summary>

#### Name : `amount`

#### Description :&#x20;

A positive integer that define the amount of heat you want to be consumed/produced.&#x20;

Note : the amount here is not a temperature, but the heat stored by the machine.

`stored_heat = machine_temperature * heat_capacity`

If you want to know how much the machine temperature will change depending on the amount specified here you have to do :&#x20;

`temperature_change = amount / base_temperature`

where temperatures and capacity are in Kelvin.

#### Example :&#x20;

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

The recipe will consume/produce 1000 heat. If the machine heat capacity is 273K (default), the machine temperature will increase/decrease by 1000/273=3.66K

</details>

#### Optional properties

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

<details>

<summary>Delay</summary>

#### Name : `delay`

#### Description :

A double value, between 0.0 and 1.0 that represents at which time of the recipe the requirement action must be executed.\
A delay of 0.5 represent half of the recipe, 0.25 a quarter etc...

Doesn't work for `per_tick` requirements.

#### Default : 0

The requirement action will be executed on start if mode is input or on end if mode is output.

#### Example :

```json
"delay": 0.33
```

The requirement action will be executed when the recipe progress time is at (approximatively) a third of the recipe total duration.

#### Note :

If delay is specified the requirement will be only executed at the specified delay, independently of the mode property.

</details>

### Example

A heat requirement that will make the custom machine recipe produce 1000 of Mekanism heat with 50% chance :

```json
{
    "type": "custommachinery:heat",
    "mode": "output",
    "amount": 1000,
    "chance": 0.5
}
```
