# Redstone

Redstone requirement is used to make the recipe work only when the machine receive a specific redstone signal.

This requirement is an **input only** requirement, meaning that you don't have to define the `mode` property.&#x20;

It is used only to block or allow the usage of a recipe under certain conditions but don't have any real inputs or outputs.

The requirement type of redstone requirement is : `"custommachinery:redstone"`.

### Properties

The redstone requirement have 2 mandatory properties and 1 optional property.

#### Mandatory properties

```json
"type": "custommachinery:redstone" //Mandatory to define a redstone requirement.
```

<details>

<summary>Power</summary>

#### Name : `power`

#### Description :&#x20;

The redstone signal power needed for the machine to work, this will be compared to the machine received redstone signal using the `comparator` property.

### Example :&#x20;

```json
"power": 1
```

</details>

#### Optional properties

<details>

<summary>Comparator</summary>

#### Name : `comparator`

A [Comparator](https://frinn.gitbook.io/custom-machinery-1.16/misc/comparator), that define how the specified value in the `power` property will be compared to the machine received redstone signal.

#### Default : `>=`

The recipe will start only if the machine received redstone signal is greater or equals to the power specified in the `power` property.

#### Example :&#x20;

```json
"comparator": "=="
```

The recipe will only start if the machine received redstone signal is equals to the power specified in the `power` property.

</details>

### Example

A redstone requirement that will make the recipe start only if the machine received redstone signal is lower or equals than 8.

```json
{
    "type": "custommachinery:redstone",
    "power": 8,
    "comparator": "<="
}
```
