> For the complete documentation index, see [llms.txt](https://frinn.gitbook.io/custom-machinery-1.21/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/button.md).

# Button

Make the recipe start only if a button is pressed on the machine gui.

Button requirement is used to make the custom machine recipe start only when the player press a button in the machine gui.

The button requirement is an input only requirement, meaning that you don't have to define the `mode` property.

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

### Properties

The button requirement has 2 mandatory properties and 1 optional property.

#### Mandatory properties

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

<details>

<summary>Id</summary>

#### Name : `id`

#### Description :&#x20;

The string id of the [button element](/custom-machinery-1.21/creating-custom-machines/machine-gui/button-element.md) that must be pressed.

#### Example :&#x20;

The recipe will start only if the button with id `button1` is pressed by the player.

```json
"id": "button1"
```

</details>

#### Optional property

<details>

<summary>Inverse</summary>

#### Name : `inverse`

#### Description :&#x20;

A boolean that will make the recipe require the button to **not** be pressed.

#### Default : `false`

#### Example :&#x20;

The recipe will start if the button is not pressed :&#x20;

```json
"inverse": true
```

</details>

### Example

A button requirement that will make the recipe start only if the button element with id `diamond` is pressed by the player :&#x20;

```json
{
    "type": "button",
    "id": "diamond"
}
```
