> 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/mod-integrations/crafttweaker-deprecated/recipes/button.md).

# Button

Use the button requirement in a CT recipe

**Use one of these methods to add a** [**Button Requirement**](/custom-machinery-1.21/recipes/requirements/button.md) **to the recipe.**

```javascript
.requireButtonPressed("id")

.requireButtonReleased("id")
```

* The `id` param must be a string that define which [button element](/custom-machinery-1.21/creating-custom-machines/machine-gui/button-element.md) need to be pressed to start the recipe.

### Example

This recipe will produce 10FE each time the player press the button :&#x20;

```javascript
<recipetype:custommachinery:custom_machine>.create("custommachinery:dynamo", 1)
.requireButtonPressed("button")
.produceEnergy(10)
.build();
```
