# Effect

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

```javascript
.giveEffectOnEnd("effect", time, radius)
.giveEffectOnEnd("effect", time, radius, level)
.giveEffectOnEnd("effect", time, radius, filter)
.giveEffectOnEnd("effect", time, radius, level, filter)

.giveEffectEachTick("effect", time, radius)
.giveEffectEachTick("effect", time, radius, level)
.giveEffectEachTick("effect", time, radius, filter)
.giveEffectEachTick("effect", time, radius, level, filter)
```

* The `effect` param must be a string defining a valid effect id. Example : `minecraft:regeneration`
* The `time` and `radius` params must be a positive integer.
* The `level` param must be a positive integer. \
  Default : `1`
* The `filter` param must be an array of string defining a valid entity id. \
  Example : `["minecraft:cow", "minecraft:pig"...]` \
  Default : `[]`

### Example

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

  event.recipes.custommachinery.custom_machine("custommachinery:power_crusher", 100)
  .giveEffectOnEnd("minecraft:speed", 600, 10)
  
})
```
