Interface AdvancementCriterion
- All Known Implementing Classes:
AutoGrantCriterion, BlockMinedCriterion, CustomAttributeCriterion, CustomStatisticCriterion, EntityKilledCriterion, ItemCraftedCriterion, ItemHasCriterion, LevelCriterion, LocationCriterion, PotionEffectCriterion, StatisticCriterion
public interface AdvancementCriterion
Represents a logical condition that a player must fulfill to progress in an advancement.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Codec<AdvancementCriterion> Codec for serialization. -
Method Summary
Modifier and TypeMethodDescriptionRetrieves the specific Event class that this criterion listens for.getType()Retrieves the type definition associated with this specific criterion instance.booleanisMet(org.bukkit.entity.Player player) Evaluates whether the player currently meets the conditions of this criterion.default booleanisMet(org.bukkit.entity.Player player, org.bukkit.event.Event event) Evaluates whether the player meets the conditions based on a specific event trigger.
-
Field Details
-
CODEC
Codec for serialization.
-
-
Method Details
-
getType
CriterionType<?> getType()Retrieves the type definition associated with this specific criterion instance.- Returns:
- The
CriterionTypecharacterizing this instance.
-
isMet
boolean isMet(org.bukkit.entity.Player player) Evaluates whether the player currently meets the conditions of this criterion.- Parameters:
player- ThePlayerto evaluate.- Returns:
- True if the condition is met, false otherwise.
-
isMet
default boolean isMet(org.bukkit.entity.Player player, org.bukkit.event.Event event) Evaluates whether the player meets the conditions based on a specific event trigger.- Parameters:
player- ThePlayerinvolved in the event.event- TheEventthat triggered this evaluation.- Returns:
- True if the event satisfies the criterion requirements.
-
getTargetEvents
Retrieves the specific Event class that this criterion listens for. If this returns empty set, the criterion will be treated as global and evaluated on state changes.- Returns:
- The set of target
Eventclasses, or empty if not event-specific.
-