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

# Item filter

Use the item filter requirement in a KubeJS recipe.

U**se one of these methods to add an** [Item filter](/custom-machinery-1.19/recipes/requirements/item-filter.md) **requirement to the recipe.**

```javascript
.requireItemFilter(Ingredient ingredient)
.requireItemFilter(Ingredient ingredient, String slot)
```

* The `ingredient` param must be an Ingredient.\
  KubeJS support various ingredient types : "item\_id", "#tag\_id", "@mod\_id" or even regex.
* The `slot` param must be a valid slot id.

### Example

The following recipe will run only if the filter slot "filter1" is set to a vanilla diamond :&#x20;

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

  event.recipes.custommachinery.custom_machine("custommachinery:power_crusher", 100)
  .requireItemFilter("minecraft:diamond", "filter1")
})
```
