Meridian logoMERIDIANWIKI Open in the interactive wiki Map Main site Vote Rules Store
E.08 — Life on Meridian

Hopper filters

Filter any hopper by writing what it should take, in plain text: an item, a tag, an enchantment, a potion, durability, a name, who threw it, and much more. No redstone item sorters, no filler items.

Hopper filters use Hopplet by jwkerr. This page is adapted from the Hopplet wiki (MIT licence). It replaces the old left-click item locks: hoppers you locked before are turned into the matching filter automatically the first time their area loads.

Making a filter

  1. 1
    Open the filter editor

    With nothing in your main hand, sneak and right-click a hopper or a hopper minecart. You can also look at it and type /hopplet edit. It only opens where you're allowed to break the hopper, so nobody can change the filters in your town.

The filter editor. Type your filter in the Filter Input box.
The filter editor. Type your filter in the Filter Input box.
  1. 2
    Write the filter

    Type it into the Filter Input box, using the syntax and functions below (up to 512 characters).

  2. 3
    Check it

    Press the aqua Validate button. Any mistake shows up in red above the box, with where it is.

Validate checks the filter, Confirm saves it, Cancel closes the editor.
Validate checks the filter, Confirm saves it, Cancel closes the editor.
A mistake: the closing quote after Fruitloopins is missing.
A mistake: the closing quote after Fruitloopins is missing.
Fixed. The filter is fine now.
Fixed. The filter is fine now.
  1. 4
    Save it

    Press Confirm. The hopper's name becomes your filter, in gold, and from now on it only takes items that pass.

A hopper filtered by book author took the book Fruitloopins wrote.
A hopper filtered by book author took the book Fruitloopins wrote.

Good to know

  • Removing a filterOpen the editor, clear the box and press Confirm. The hopper takes anything again.
  • Gold names are filtersA hopper's filter is its gold name. Breaking and placing the hopper keeps it, like any named block.
  • Anvils don't make filtersNaming a hopper in an anvil just names it, so you can still label hoppers normally. Only the editor makes filters.
  • A broken filter takes nothingIf a filter has a mistake in it, the hopper accepts no items at all until it's fixed, so nothing ends up in the wrong place.
  • Old item locksHoppers locked with the old left-click lock become filters like type(diamond) (plus the potion, enchantment or name they were locked to). Left-clicking a hopper with an item doesn't lock it any more.
  • Need help?Ask in our Discord: the editor links here and to it.

Syntax

A filter is one or more functions (checks on the item), joined with and, or and not.

SymbolMeaningExample
function(arguments)A check that an item has to pass.type(diamond), name("Secret Item")
&Both sides must be true.type(diamond_sword) & ench(sharpness)
|Either side can be true.type(gold_ingot) | thrower(Fruitloopins)
!Not: flips the check after it.!enchanted()
( )Groups checks so they're worked out together first.type(gold_ingot) | (author(Fruitloopins) & generation(copy_of_copy))
" "Wraps an argument so spaces and symbols are kept. It's good practice to quote every argument.ench("sharpness >= 4")

Comparators

Some functions take comparisons instead of names, to set limits. For example durability(>=75, <=90) means the item has between 75% and 90% of its durability left.

ComparatorMeans
=equal to
!=not equal to (must be in quotes)
>more than
<less than
>=at least
<=at most

Examples

What you wantFilter
Only diamondstype(diamond)
Any ore block or raw oretype_ends_with(_ore) | type_starts_with(raw_)
All wool, any colourtag(wool)
Food, but not rotten fleshedible() & !type(rotten_flesh)
Fire resistance potions (any length)type(potion) & effect(fire_resistance)
Sharpness IV or better swordstype_ends_with(_sword) & ench("sharpness >= 4")
Worn-out tools to repair (under 25% left)damaged() & durability(<25)
Things that can go in a furnace as fuelfuel()
Only items your town's players drop intown(YourTown)
Everything except cobblestone!type(cobblestone)

Meridian's own items

Our custom items look like ordinary items to the functions below, so they have their own function: custom(name).

FilterTakes
custom(debuff_resistance)Potions of Debuff Resistance: drinkable, splash and lingering, and Debuff Resistance arrows. Add & type(splash_potion) for one kind only.
custom(wrench)Wrenches, but not ordinary sticks.
custom(debuff_resistance, wrench)Either of them.
type(potion) & !custom(debuff_resistance)Every drinkable potion except Debuff Resistance.

Functions

Every check you can use. Names in small print are shorter aliases that work the same way. Arguments are separated by commas: functions that take a list match if the item fits any of them, except where it says all. In game, /hopplet function <name> explains any of them.

FunctionTakesTrue when…Example
amount
size
comparatorEvaluates to true if an item stack's size matches all the specified amounts.amount(>32, <48)
armor_trim_material
trim_material
trim materialEvaluates to true if an item's armor trim material matches one of the specified materials.trim_material(gold)
armor_trim_pattern
trim_pattern
trim patternEvaluates to true if an item's armor trim pattern matches one of the specified patterns.trim_pattern(silence)
book_author
author
usernameEvaluates to true if a book's author matches one of the specified strings.author(Fruitloopins)
book_generation
generation
generationEvaluates to true if a book's generation matches one of the specified generations.generation(copy_of_copy)
book_title
title
stringEvaluates to true if a book's title matches one of the specified titles.title("Special Book")
display_name_contains
name_contains
stringEvaluates to true if an item's display name contains all the specified strings.name_contains(stone, moss)
display_name_ends_with
name_ends_with
stringEvaluates to true if an item's display name ends with one of the specified strings.name_ends_with(map)
display_name
name
stringEvaluates to true if an item's display name matches one of the specified strings.name("Super Secret Access Key")
display_name_starts_with
name_starts_with
stringEvaluates to true if an item's display name starts with one of the specified strings.name_starts_with(mossy, diamond)
durability
dur
comparator, stringEvaluates to true if an item matches all the specified damage amounts as a percentage.durability(max, undamaged), durability(>=90)
enchantment
ench, enchant
enchantmentEvaluates to true if an item has all the specified enchantments.ench("sharpness >= 4", fire_aspect)
has_armor_trim
is_trimmed, trimmed
–Evaluates to true if an item has an armor trim applied.trimmed()
has_custom_name
is_renamed, renamed
–Evaluates to true if an item has been renamed.renamed()
has_lore
lored
–Evaluates to true if an item has lore.lored()
is_compostable
compostable
–Evaluates to true if an item can be composted.compostable()
is_damaged
damaged
–Evaluates to true if an item is damaged.damaged()
is_edible
edible, is_food, food
–Evaluates to true if an item is edible.edible()
is_enchanted
enchanted
–Evaluates to true if an item is enchanted.enchanted()
is_fuel
fuel
–Evaluates to true if an item is usable as fuel in a furnace.fuel()
is_repairable
repairable
–Evaluates to true if an item is repairable in an anvil.repairable()
is_smeltable
smeltable
–Evaluates to true if an item is smeltable in a furnace.smeltable()
is_stackable
stackable, can_stack
–Evaluates to true if an item's type is stackable.stackable()
is_unbreakable
unbreakable
–Evaluates to true if an item is unbreakable.unbreakable()
lore_containsstringEvaluates to true if an item's lore contains all the specified strings.lore_contains("3 levels")
lore_ends_withstringEvaluates to true if an item's lore ends with one of the specified strings.lore_ends_with("(33 experience)")
lorestringEvaluates to true if an item's lore matches ones of the specified strings.lore("3 levels (33 experience)")
lore_starts_withstringEvaluates to true if an item's lore starts with one of the specified strings.lore_starts_with("3 levels")
map_id
map
comparatorEvaluates to true if a map's ID matches all the specified comparators.map_id(>=5, <=15, 1337)
material_contains
type_contains
stringEvaluates to true if an item's material name contains all the specified strings.type_contains(stone)
material_ends_with
type_ends_with
stringEvaluates to true if an item's material name ends with one of the specified strings.type_ends_with(e)
material
type
materialEvaluates to true if an item is of any specified material.type(cobblestone, mossy_cobblestone)
material_starts_with
type_starts_with
stringEvaluates to true if an item's material name starts with one of the specified strings.type_starts_with(diamond, iron)
potion_duration
duration, pot_dur
comparator, stringEvaluates to true if a potion has all the specified durations in ticks.duration(>=3600), duration(infinite, unlimited), duration(3600)
potion_effect
effect, pot_eff, eff
potion effectEvaluates to true if an item has all the specified potion effects.effect("speed = 2", invisibility, instant_health>=1)
potion_type
pot_type
potion typeEvaluates to true if a potion's base type matches one of the specified potion types.pot_type(mundane)
source_inventory_type
source_type, source
inventory typeEvaluates to true if an item's source is of one of the specified types.source(barrel)
rarityitem rarityEvaluates to true if an item matches one of the specified item rarities.rarity(common)
skull_owner
head_owner
username, uuidEvaluates to true if a head's owner matches one of the specified UUIDs or usernames.head_owner(Fruitloopins)
skull_texture
head_texture
base64Evaluates to true if a head's texture matches one of the specified Base64 strings.head_texture(eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvMjA4NGVmNjBjNjUwYjRmMjZiMDZiMDUxOTI4MWU2YzQxNjA5YTVjZDllY2JkNjk3YjljZjE2ZWViZjc4NWI0OCJ9fX0=)
smeltable_byinventory typeEvaluates to true if an item can be smelted in one of the specified furnace types.smeltable_by(smoker, blast_furnace)
stored_experience
stored_exp, stored_xp, experience, exp, xp
comparatorEvaluates to true if an experience bottle's stored experience matches all the specified amounts. (Uses bottlet, which Meridian has.)xp(>=1395)
tag
tagged
item tag), block tag)Evaluates to true if an item has one of the specified tags.tag(wool), tag(beds)
thrower
thrown_by
username, uuidEvaluates to true if an item was thrown by one of the specified UUIDs or usernames.thrower(Fruitloopins, 12BarBruise), thrown_by(fed0ec4a-f1ad-4b97-9443-876391668b34)
thrower_nation
thrower_nation, nation
nationEvaluates to true if an item was thrown by a member of one of the specified nations. (Uses towny, which Meridian has.)nation(Australia)
thrower__town
thrower_town, town
townEvaluates to true if an item was thrown by a member of one of the specified towns. (Uses towny, which Meridian has.)town(Melbourne)

How an item gets in

StepWhat happens
1. The item tries to get inEither it's moved in from a container or hopper above or beside it, or it's lying on top of the hopper as a dropped item.
2. The filter is readThe hopper's gold name is turned into a filter (and remembered while the chunk is loaded). If the filter has a mistake in it, the hopper takes nothing until you fix it.
3. Filters go firstA hopper without a filter normally takes anything. But if a filtered hopper under or beside the same container is looking for exactly that item and has room, the item goes to the filtered hopper instead. So a row of filter hoppers under a chest catches what it's meant to, rather than an unfiltered hopper grabbing it first.
4. The item is checkedNo filter: it goes in. A filter: it goes in only if it passes. If the first item in a container doesn't pass, the hopper takes the next one that does, so one wrong item can't clog a sorting line.

Commands

CommandWhat it does
Sneak + right-clickWith an empty main hand, on a hopper or hopper minecart: open the filter editor.
/hopplet editOpen the editor for the hopper or hopper minecart you're looking at.
/hopplet function <name>Show what a function does and how to use it, e.g. /hopplet function ench.