Class CriterionRegistry
java.lang.Object
net.fabricmc.fabric.api.object.builder.v1.advancement.CriterionRegistry
Allows registering advancement criteria for triggers.
A registered criterion (trigger) can be retrieved through
Criteria.getById(Identifier)
.
- See Also:
Criteria
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T extends net.minecraft.advancement.criterion.Criterion<?>>
Tregister(T criterion)
Registers a criterion for a trigger for advancements.
-
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 sameid
exists
-