MinionCore logoMinionCore

Filters

How minion filters keep the drops you want and throw the rest away, with item groups and the filter menu.

A filter decides which drops a minion keeps. Keep only the ores from a miner, throw away rotten flesh from a hunter, or stop a fisherman filling up with pufferfish. Players set filters up in a menu by clicking items, and server owners can give each minion type a starting filter.

The two modes

ModeWhat it does
ACCEPTKeeps only the items in the filter. Everything else is rejected.
IGNORERejects the items in the filter. Everything else is kept.

A filter with no entries keeps everything, in either mode. So a fresh minion with the shipped settings stores all of its drops until someone adds an entry.

What happens to rejected drops

# config.yml
output:
  filter-reject: VOID
ValueWhat happens
VOIDRejected drops are deleted. This is the default.
DROPRejected drops are dropped on the ground at the minion. For a hunter they are left where the mob died.

This setting is shared by every minion on the server.

The filter menu

Players open the filter from the Filter button in the minion menu (slot 38 in the shipped gui.yml). The button shows the current mode.

Add an item

Left click any item in your own inventory while the filter menu is open. Its type is added to the filter and a chat message confirms it. The item stays in your inventory. Shift clicking works the same way.

Remove an entry

Click the entry in the top part of the menu. It is taken out of the filter straight away.

Switch the mode

Click the Mode button to swap between ACCEPT and IGNORE. The entries stay the same, only their meaning flips.

Add a whole group

Click Groups to open the groups menu. Click a group to add it, click it again to take it out. Groups already in the filter show as an enchanted book and say "In the filter". When there are more groups than fit on one page, the Previous and Next buttons move between pages.

Every change is saved the moment it is made, so nothing is lost if the server stops right after. The minion also starts working again straight away if it was waiting.

Up to 36 entries fit on one page. With more, the Previous and Next buttons appear.

Who may change a filter is covered on Trust and access. The owner always can, and trusted players can when trusted.filter is true in the type file, which it is in every shipped file.

Entries

A filter entry is one of these:

EntryExampleWhat it matches
A material nameCOBBLESTONEEvery item of that material.
An ItemsAdder itemitemsadder:namespace:idThat one ItemsAdder item.
A group nameoresEvery material in that group from filters.yml.

Clicking an ItemsAdder item in your inventory adds it by its ItemsAdder id, not by its base material.

Groups in filters.yml

Groups save players from adding twenty ores one by one. They live in filters.yml, and each group is a name with a list of materials. The shipped groups are:

GroupMaterials
ores19 ores, every coal, iron, copper, gold, redstone, lapis, diamond and emerald ore in stone and deepslate, plus nether gold ore, nether quartz ore and ancient debris
cropsWHEAT, CARROT, POTATO, BEETROOT, NETHER_WART, COCOA_BEANS, SUGAR_CANE, MELON_SLICE, PUMPKIN, WHEAT_SEEDS, BEETROOT_SEEDS, MELON_SEEDS, PUMPKIN_SEEDS
logsOAK_LOG, SPRUCE_LOG, BIRCH_LOG, JUNGLE_LOG, ACACIA_LOG, DARK_OAK_LOG, MANGROVE_LOG, CHERRY_LOG, CRIMSON_STEM, WARPED_STEM
mob_dropsROTTEN_FLESH, BONE, ARROW, STRING, SPIDER_EYE, GUNPOWDER, ENDER_PEARL, SLIME_BALL, BLAZE_ROD, LEATHER, BEEF, PORKCHOP, CHICKEN, MUTTON, FEATHER
fishCOD, SALMON, TROPICAL_FISH, PUFFERFISH

Add your own group like this:

groups:
  gems:
    - DIAMOND
    - EMERALD
    - AMETHYST_SHARD

A material that does not exist on your Minecraft version is skipped with a warning. Group names are not case sensitive.

The top of filters.yml also has a master switch:

enabled: true

Set it to false to turn filters off on every minion and collector. Drops are then all kept.

Starting filters in type files

Each file in minions/ has a filter section:

filter:
  enabled: true
  mode: ACCEPT
  entries: []
KeyDefaultWhat it does
enabledtrueWhether this type may use a filter. With it off, the Filter button tells the player filters are switched off and every drop is kept.
modeACCEPTThe mode a new minion starts with.
entries[]The entries a new minion starts with. Materials, itemsadder: ids and group names all work.

For example, a miner type that keeps only ores from the start:

filter:
  enabled: true
  mode: ACCEPT
  entries:
    - ores
    - COAL
    - RAW_IRON
    - RAW_COPPER
    - RAW_GOLD
    - REDSTONE
    - LAPIS_LAZULI
    - DIAMOND
    - EMERALD

mode and entries are only a starting point. Once a player changes a minion's filter in the menu, that minion keeps its own filter, and later edits to the type file no longer change it.

Filters on collectors

A chunk collector has a filter of its own, set up in the same menu.

  • Output from paired minions. The producing minion's filter runs first. Of the drops it keeps, the collector takes only what its own filter accepts. Anything the collector refuses goes into the producing minion's own storage instead, so it is not lost.
  • Items already stored in paired minions. When the collector pulls items out of a paired minion's storage, it only takes what its own filter accepts. The rest stays in the minion.
  • Items on the ground. A collector in GROUND or BOTH mode only picks up items its filter accepts. The rest stay on the ground.
  • Block filter to choose which blocks a miner, farmer or lumberjack breaks, rather than which drops it keeps

  • Menus to change the look and slots of the filter menus in gui.yml

  • Minion type files for the rest of each type file

  • Configuration for the other output settings

On this page