Item filter

Make the recipe requires a filter slot to be set to a specific item.

The item filter requirement will make the recipe requires an item component set to Filter 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 :

Mandatory properties

"type": "custommachinery:item_filter"
Ingredient

Name : ingredient

Description :

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 :

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

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

Optional property

Slot

Name : slot

Description :

The id of an item component as specified in the item component property.

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

Default : none

Example :

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

"slot": "filter1"

Example

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

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

Last updated