Wiki 9Minecraft Wiki 9Minecraft
Integrated Scripting Wiki › Guides › Create a Predicate Filter Script for Tunnel Exporters

Create a Predicate Filter Script for Tunnel Exporters

Understanding Predicate Filters

Predicate filters let you control which items an exporter sends through tunnels based on custom conditions. Instead of simple whitelist/blacklist logic, scripts allow complex rules like "export only if inventory is above 50% full" or "prioritize diamonds over stone."

Writing the Filter Logic

Access the item being evaluated and the current network state. Your script should return true (export this item) or false (skip it). You can check:

  • Item type and NBT data
  • Quantity thresholds
  • Destination inventory status
  • Time-based conditions

Connecting to Your Exporter

Once your script is written, assign it to an Integrated Tunnels exporter component. The exporter will run your predicate on each item it encounters, making routing decisions automatically. This is far more powerful than static filters and adapts to your system's changing needs.