> 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/entity.md).

# Entity

Use the entity requirement in a KubeJS recipe

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

```javascript
.requireEntities(amount, radius, filter, whitelist)

.requireEntityHealth(amount, radius, filter, whitelist)

.consumeEntityHeathOnStart(amount, radius, filter, whitelist)

.consumeEntityHealthOnEnd(amount, radius, filter, whitelist)

.killEntitiesOnStart(amount, radius, filter, whitelist)

.killEntitiesOnEnd(amount, radius, filter, whitelist)
```

* The `amount` and `radius` params must be a positive integer.
* The `filter` param must be an array of string defining a valid entity id. \
  Example : `["minecraft:cow", "minecraft:pig"...]`
* The `whitelist` param must be a boolean, if true the filter will be a whitelist, if false it will be a blacklist.

### Example

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

  event.recipes.custommachinery.custom_machine("custommachinery:power_crusher", 100)
  .requireEntities(1, 10, "minecraft:cow", true)
  
})
```
