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:

  • (Object): A material predicate object.
    • type (Resource Location): Always tconstruct:id.
    • id (Material ID): Material ID to match.
    • id (Array): Set of Material IDs, matches if the ID is any in the set.

Variant

Matches a set of material IDs, ignoring variants. See ID if you need to ignore variants. It has the following format:

  • (Object): A material predicate object.

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:

  • (Object): A material predicate object.

Has Part

The has part predicate matches materials that support being used to craft a specific part. It has the following format:

  • (Object): A material predicate object.
    • type (Resource Location): Always tconstruct:has_part.
    • part (item ID): Tool part item to check. Expected to be an instance of IMaterialItem.

Tier

The material tier predicate matches materials with tiers in the given range. It has the following format:

  • (Object): A material predicate object.