Working with StatePredicates for Block Testing
What Are StatePredicates?
StatePredicates are tools that test the current state of blocks in the world. Unlike StackPredicates (which check items), StatePredicates examine block properties like rotation, power level, or custom data stored on a block.
Types of Block States You Can Test
StatePredicates can check:
- Redstone power levels
- Rotation and facing direction
- Whether a block is lit or active
- Custom properties added by mods
- Fluid-logged status or similar compound states
Practical Use Cases
Mods use StatePredicates to build conditional logic. A machine might only activate if the block above it is in a specific state, or a detector might trigger only when certain neighboring blocks match a pattern.
For Players
You won't directly configure StatePredicates in survival mode. However, understanding them helps you troubleshoot automation setups. If a machine isn't responding as expected, the issue might be that a block state doesn't match what the machine's predicate requires. Check the connected mod's guide for state requirements.