Block Predicates
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 extendsBushBlock.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:
- A block predicate object.
- Always
mantle:set. - List of block IDs, matches if any match the input.
- Block ID option to match.
- Always
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:
- A block predicate object.
- Always
mantle:block_properties. - Block to match. All block properties must come from the passed block.
- Map of property name to expected value. Matching behavior varies based on the type of the values:
- Property will exactly match when
<name>is the given string value. - Property will match if
<name>is any value within the list.- Option for
<name>.
- Option for
- Property will match if
<name>is within the passed range of values.- Minimum value for
<name>. If unset, property matches with no minimum value. - Maximum value for
<name>. If unset, property matches with no maximum value.
- Minimum value for
- Property will exactly match when
- Always
Harvest Tier
The harvest tier block predicate matches any blocks which can be harvested using the given harvest tier. It has the following fields:
- A block predicate object.
- Always
tconstruct:harvest_tier. - Harvest tier to match.
- Always
Block Variable
The block variable predicate is a variable predicate that matches using Block Variable. See that section for more information on the JSON format.