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

# Item filter

The item filter requirement will make the recipe requires an item component set to [Filter](/custom-machinery-1.21/creating-custom-machines/machine-components/item-component/filter.md) variant to be set to a specific item.

If the filter slot is cleared during the recipe processing the machine will stop and display an error, if the filter is set again the process will resume.

The requirement type of item filter requirement is :  "`custommachinery:item_filter"`.

### Requirements

The item filter requirement has 2 mandatory properties and 1 optional property :&#x20;

#### Mandatory properties

```json
"type": "custommachinery:item_filter"
```

<details>

<summary>Ingredient</summary>

#### Name : `ingredient`

#### Description :&#x20;

Any ingredient or list of ingredients defined as in vanilla recipe json.

An ingredient can be defined by item `{"item": "minecraft:stick"}` or by tag `{"tag": "minecraft:wood"}`

#### Example :&#x20;

The recipe will requires that either a stick or a paper must be placed in a filter slot.

```json
"ingredient": [{"item": "minecraft:stick"}, {"item": "minecraft:paper"}]
```

</details>

#### Optional property

<details>

<summary>Slot</summary>

#### Name : `slot`

#### Description :&#x20;

The id of an item component as specified in the item component [Item component](/custom-machinery-1.21/creating-custom-machines/machine-components/item-component.md#id) property.

If specified the requirement will check the filter of this slot only, otherwise it will check any filter slots.

#### Default : none

#### Example :&#x20;

The recipe will check the filter item component with id "filter1".

```json
"slot": "filter1"
```

</details>

### Example

An item filter requirement that will make the recipe run only if the filter slot "filter1" is set to a vanilla diamond :&#x20;

```json
{
    "type": "custommachinery:item_filter",
    "ingredient": {"item": "diamond"},
    "slot": "filter1"
}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/item-filter.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
