# Pressure (PNC)

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

The pressure requirement can be used in a recipe to require a specific pressure and/or consume/produce compressed air from PneumaticCraft.

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

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

* Input : require pressure and/or consume air.
* Output : produce air.

Pressure requirement must be defined in json with : `"type": "custommachinery:pressure"` .

### Properties

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

#### Mandatory properties

```json
"type": "custommachinery:pressure"
```

<details>

<summary>Mode</summary>

#### Name : `mode`

#### Description :

Define the I/O mode of the requirement.

* `input` The requirement will check for specified pressure and consume compressed air at the start of the crafting process.
* `output` The requirement will produce compressed air at the end of the crafting process.

#### Example :

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

</details>

#### Optional properties

<details>

<summary>Min</summary>

#### Name : `min`&#x20;

#### Description :&#x20;

A decimal value between -1.0 and 25.0 that define the minimal pressure needed to start the recipe.

#### Default : -1.0

#### Example :&#x20;

The recipe will start if the machine's pressure is above 2bar.

```json
"min": 2.0
```

</details>

<details>

<summary>Max</summary>

#### Name : `max`&#x20;

#### Description :&#x20;

A decimal value between -1.0 and 25.0 that define the maximal pressure needed to start the recipe.

#### Default : 25.0

#### Example :&#x20;

The recipe will start if the machine's pressure is below 8bar.

```json
"max": 8.0
```

</details>

<details>

<summary>Volume</summary>

Name : `volume`&#x20;

Description :&#x20;

A positive integer that define the amount of compressed air that will be consumed or produced by the recipe depending of whether the `mode` is input or output.

Default : 0

No compressed air will be consumed or produced by the recipe.

Example :&#x20;

Set the recipe to consume/produce 1000mL compressed air.

```json
"volume": 1000
```

</details>

### Example

A pressure requirement that will make the recipe run only if the machine pressure is between 2bar and 3bar and consume 100mL of compressed air :&#x20;

```json
{
    "type": "custommachinery:pressure",
    "mode": "input",
    "min": 2,
    "max": 3,
    "volume": 100
}
```

A pressure requirement that will make the recipe produce 200mL of compressed air :&#x20;

```json
{
    "type": "custommachinery:pressure",
    "mode": "output",
    "volume": 200
}
```
