Block predicates match block state values and properties in JSON.

The following sections discuss supported serializers.

Common Predicates

Block predicates support all common predicate serializers (including tag predicates).

In 1.18, some uses of block predicates used a version defined by Tinkers’ Construct where all common predicate along with the required_tool predicate were registered under a domain of tconstruct instead of mantle.

Simple Predicates

The following predicates have no extra fields, and are simply defined by their type:

  • mantle:requires_tool: Matches any block which requires mining with the correct tool to drop items from it’s loot table.

Since 1.19:

  • tconstruct:can_melt: Matches any block which has a melting recipe.

Since 1.20:

  • mantle:blocks_motion: Matches any block which prevents an entity from moving through it.
  • mantle:can_be_replaced: Matches any block which is replaced upon placing a block.
  • tconstruct:bush: Matches any block which extends BushBlock.
  • tconstruct:can_be_replaced: Matches any block which is replaced upon placing a block.

Block Set

The block set predicate matches if the block is within the given set. Block set predicates are effectively a hardcoded block tag predicate, useful when a set is not reusable enough to need a specific tag.

Block set predicates have the following format:

  • (Object): A block predicate object.
    • type (Resource Location): Always mantle:set.
    • blocks (Array): List of block IDs, matches if any match the input.

In 1.18, some uses of the block predicate used a version defined by Tinkers’ Construct. For those block predicates, the block set predicate had a type of tconstruct:set.

Block Properties

The block properties predicate matches a given block state on a list of block properties. It has the following format:

  • (Object): A block predicate object.
    • type (Resource Location): Always mantle:block_properties.
    • block (Block ID): Block to match. All block properties must come from the passed block.
    • properties (Object): Map of property name to expected value. Matching behavior varies based on the type of the values:
      • <name> (String): Property will exactly match when <name> is the given string value.
      • <name> (Array): Property will match if <name> is any value within the list.
        • (String): Option for <name>.
      • <name> (Object): Property will match if <name> is within the passed range of values.
        • min (String): Minimum value for <name>. If unset, property matches with no minimum value.
        • max (String): Maximum value for <name>. If unset, property matches with no maximum value.

Harvest Tier

The harvest tier block predicate matches any blocks which can be harvested using the given harvest tier. It has the following fields:

  • (Object): A block predicate object.

Block Variable

Since 1.20

The block variable predicate is a variable predicate that matches using Block Variable. See that section for more information on the JSON format.