Minecraft Hopper filter

The hopper filter allows you to specify which items are allowed to pass through based on name patterns, tags, and item properties. Renaming a hopper applies the filter.
Hopplet is open-source and made by Fruitloopins.
Creating a hopper filter
The only way to create a filter is through a dialog. With no item in your main hand, sneak and right-click a hopper or hopper minecart as though you were going to open it to view its contents. If you have permission to edit this hopper, an interface will open that looks like this:

This system also allows you to check if the filter is written correctly (we will provide examples for filters below) using "Validate" button. If something goes wrong, it will tell you what the issue is, otherwise, you're good to go!
Functions
Hopper filter heavily relies on functions to be able to filter items in a detailed matter. All functions require to use "function(args)" format, where "function" is the function name and "args" is the specified filter of your choice. Some functions also require the use of " for their proper functioning (it is preferred to use quotation for all filters).
| Function Name | Description | Usage |
|---|---|---|
amount/size | Checks if an item stack's size matches all the specified amounts. | amount(>32, <48) |
trim_material | Checks if an item's armor trim material matches one of the specified materials. | trim_material(gold) |
trim_pattern | Checks if an item's armor trim pattern matches one of the specified patterns. | trim_pattern(silence) |
book_author | Filters books made by the specified author. | author(Veyronity) |
book_generation | Filters books of the specified generation. | generation(copy_of_copy) |
name | Only accepts items with an exact name. (Ignores name color) | name("Super Secret Access Key") |
name_starts_with | Accepts items starting with a specified string. | name_starts_with(mossy, diamond) |
name_contains | Accepts items containing specified string. | name_contains(stone, moss) |
name_ends_with | Accepts items ending with a specified string. | name_ends_with(map) |
durability | Filters tools and armor of specified state (damage severity). | durability(max, undamaged), durability(>=90) |
enchantment | Filters tools and armor containing specified enchantments. | ench("sharpness >= 4", fire_aspect) |
is_trimmed | Only accepts trimmed armor. | trimmed() |
is_food | Only accepts edible items (food). | edible() |
is_enchanted | Only accepts enchanted items. | enchanted() |
is_fuel | Only accepts items usable as fuel in a furnace. | fuel() |
is_repairable | Only accepts repairable in an anvil items. | repairable() |
is_smeltable | Only accepts smeltable items. | smeltable() |
is_stackable | Only accepts stackable items. | stackable() |
is_unbreakable | Only accepts unbreakable items (items with "unbreakable" line in the description). | unbreakable() |
material | Filters items of a specified material. | type(cobblestone, mossy_cobblestone) |
material_starts_with | Filters items starting with a specified material name. | type_starts_with(diamond, iron) |
material_contains | Filters items containing specified material name. | type_contains(stone) |
material_ends_with | Filters items ending with a specified material name. | type_ends_with(e) |
potion_duration | Checks if a potion has all the specified durations in ticks. | duration(>=3600), duration(infinite, unlimited), duration(3600) |
potion_effect | Checks if a potion has all the specified potion effects. | effect("speed = 2", invisibility, instant_health>=1) |
source_inventory_type | Checks if an item's source is of one of the specified types. | source(barrel) |
rarity | Checks if an item matches one of the specified item rarities. | rarity(common) |
smeltable_by | Checks if an item can be smelted in one of the specified furnace types. | smeltable_by(smoker, blast_furnace) |
tag | Checks if an item or a block contains one of the specified tags. | tag(wool), tag(beds) |
thrown_by | Checks if an item was thrown by one of the specified UUIDs or usernames. | thrower(Fruitloopins, 12BarBruise), thrown_by(fed0ec4a-f1ad-4b97-9443-876391668b34) |
Syntax
That allows you to customize how the functions themselves behave as all of them accept items with specified properties by default.
| Syntax | Description | Example |
|---|---|---|
function(args) | Standard look of a filter/function. | type(diamond), name("Secret Item") |
& | Two or more conditions must all be true. | type(diamond_sword) & ench(sharpness) |
| | Any of two or more conditions must be true. | type(gold_ingot) | thrower(Fruitloopins) |
! | Negates a statement. | !enchanted() |
() | Defines an expression to be evaluated separately. | type(gold_ingot) | (author(Fruitloopins) & generation(copy_of_copy)) |
" | Indicates that an argument should be treated as a literal string including spaces. Recommended to use for all arguments. | ench("sharpness >= 4") |
Usage Examples

That filter will only accept items thrown by K1kimor OR golden ingots.

That filter will accept any log or wood variant with a few nether related blocks.

That filter will only accept haste 8 potions.

Hopper filter also supports multiple lines for readability! This filter accepts gold blocks OR any copy of the copy written book authored by K1kimor.
Quirks to be aware of
Item movement when two hoppers are connected to the same source hopper
If a hopper pulling an item doesn't have a filter, the server checks if there's another hopper connected to the original source hopper that does have a filter. If there is, and that hopper's filter matches the item being moved, the server cancels the original movement to the filterless hopper. Instead, the item will go into the hopper with a filter active.
First slot only
It is important to note that vanilla Minecraft only attempts moving items from the first slot in an inventory. Hopplet does not intervene if the item in the first slot has nowhere to go, as that would create hard to understand, undefined behaviour. Players designing a filtering system are expected to give invalid items a path to go, for example a "dump" of unfiltered hoppers leading into chests at the end of your storage room. An example is a continuously connected brewer system where the stands get filled up with newer potions before getting their existing potions dumped, creating a "jam".
Broken Filter
If your filter is wrongfully done (applied filter without validation), on EarthMC it will not accept any items instead of defaulting to normal hopper behavior. That allows players to pinpoint the malfunctioning filter faster.
Hopper jamming
It is important to ensure your hoppers don't get jammed by an item in the first position of a hopper. You should always have a standard hopper for unwanted items to exit through to prevent items jamming your setup that can't pass a filter.⏎