> For the complete documentation index, see [llms.txt](https://frinn.gitbook.io/custom-machinery-1.19/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.19/mod-integrations/kubejs/recipes/button.md).

# Button

Use the button requirement in a KubeJS recipe

**Use one of these methods to add a** [**Button Requirement**](/custom-machinery-1.19/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.19/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
ServerEvents.recipes(event => {

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