Material Predicates
Since 1.20.1, material predicates are a predicate type added by Tinkers’ Construct, matching Material Variant IDs and material properties.
The following sections discuss supported serializers.
Compact
In standard usages of material predicates, a Resource Location without an object is treated as the ID of a material predicate type, useful for any of the simple predicates with no extra fields.
Some contexts support compact material predicates, which change the compact representation to a Material Variant. If there is no variant (e.g. tconstruct:iron), it will match as an ID. If there is a variant (e.g. tconstruct:slimewood#greenheart), it will match as a single Variant. If the variant is set to #default (e.g. tconstruct:whitestone#default), then it will match only that ID with no variant set as Variant.
Common Predicates
Material predicates support all common predicate serializers, which match directly on material IDs (ignoring variants).
Simple Predicates
The following predicates have no extra fields, and are simply defined by their type:
tconstruct:castasble: Matches any materials with a casting fluid.tconstruct:composite: Matches any materials with a composite fluid and base material.tconstruct:craftable: Matches any materials that are craftable in the part builder.tconstruct:not_hidden: Matches any materials that are not marked as hidden.tconstruct:registered: Matches any materials that exist in the material registry.
ID
Matches a set of material IDs, ignoring variants. See Variant if you need to match variants. It has the following format:
- A material predicate object.
- Always
tconstruct:id. - Material ID to match.
- Set of Material IDs, matches if the ID is any in the set.
- A Material ID to match.
- Always
Variant
Matches a set of material IDs, ignoring variants. See ID if you need to ignore variants. It has the following format:
- A material predicate object.
- Always
tconstruct:variant. - Material Variant ID to match.
- Set of Material Variant IDs, matches if the ID is any in the set.
- A Material Variant ID to match.
- Always
Note that since this matches on variants, if the tested ID is variantless it will only match if you include the variantless ID in the set.
Has Stat Type
The has stat type predicate matches materials that have stats for the given type. It has the following format:
- A material predicate object.
- Always
tconstruct:stat_type. - Stat Type to check.
- Always
Has Part
The has part predicate matches materials that support being used to craft a specific part. It has the following format:
- A material predicate object.
- Always
tconstruct:has_part. - Tool part item to check. Expected to be an instance of
IMaterialItem.
- Always
Tier
The material tier predicate matches materials with tiers in the given range. It has the following format:
- A material predicate object.
- Always
tconstruct:tier. - Range of tiers to match. Tiers are expected to be at minimum 0.
- Always