java.lang.Object
net.fabricmc.fabric.api.object.builder.v1.advancement.CriterionRegistry

public final class CriterionRegistry extends Object
Allows registering advancement criteria for triggers.

A registered criterion (trigger) can be retrieved through Criteria.getById(Identifier).

See Also:
Criteria
  • Constructor Details

    • CriterionRegistry

      public CriterionRegistry()
  • Method Details

    • register

      public static <T extends net.minecraft.advancement.criterion.Criterion<?>> T register(T criterion)
      Registers a criterion for a trigger for advancements.
      Type Parameters:
      T - the criterion's type
      Parameters:
      criterion - the criterion registered
      Returns:
      the criterion registered, for chaining
      Throws:
      IllegalArgumentException - if a criterion with the same id exists