Back to 9Minecraft
Wiki 9Minecraft Wiki 9Minecraft
Melonlib Wiki › Guides › Using StackPredicates to Filter Items

Using StackPredicates to Filter Items

What Are StackPredicates?

StackPredicates are utility tools that let mods (and modpack makers) test whether an item stack meets specific conditions. Instead of checking individual item properties manually, a predicate handles the logic automatically.

Common Predicate Checks

StackPredicates can verify:

  • Whether an item is in a specific dictionary category
  • If an item has certain NBT tags or data
  • Whether an item's durability is within a range
  • If an item belongs to a particular mod
  • Custom conditions defined by other mods

Where You'll Encounter Them

You won't directly use StackPredicates in survival gameplay. Instead, mod developers and pack creators use them to build machines, recipes, and filters. When a hopper, furnace, or custom machine asks "does this item fit here?" — that's a StackPredicate at work.

For Pack Makers

If you're creating a modpack, understanding StackPredicates helps you configure machines correctly. Check connected mods' documentation for which predicates they support, so you can set up filters and automation precisely.