---
description: Use the weather requirement in a KubeJS recipe
---

# Weather

**Use one of these methods to add a** [**Weather Requirement**](https://github.com/Frinn38/Custom-Machinery/wiki/Weather-Requirement) **to the recipe.**

```javascript
.requireWeather("weather")

.requireWeatherOnMachine("weather")
```

* The `weather` param must be a string defining the required weather. \
  Valid values : `clear`, `rain`, `snow`, `thunder`

### Example

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

  event.recipes.custommachinery.custom_machine("custommachinery:power_crusher", 100)
  .requireWeather("rain")
  
})
```
