# Button

**Use one of these methods to add a** [**Button Requirement**](https://frinn.gitbook.io/custom-machinery-1.19/recipes/requirements/button) **to the recipe.**

```javascript
.requireButtonPressed("id")

.requireButtonReleased("id")
```

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

### Example

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

```javascript
ServerEvents.recipes(event => {

  event.recipes.custommachinery.custom_machine("custommachinery:dynamo", 1)
  .requireButtonPressed("button")
  .produceEnergy(10)
  
})
```
