> 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/kubejs/recipes/effect.md).

# Effect

Use the effect requirement in a KubeJS recipe

**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, level, filter)

.giveEffectEachTick("effect", time, radius)
.giveEffectEachTick("effect", time, radius, level)
.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)
  
})
```
