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.
Criteria can be evaluated statically or triggered by specific server events.
-
Method Summary
Modifier and TypeMethodDescriptiongetType()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.
-
Method Details
-
getType
CriterionType<?> getType()Retrieves the type definition associated with this specific criterion instance. This is used for identifying the logic and serialization codec.- Returns:
- The
CriterionTypecharacterizing this instance.
-
isMet
boolean isMet(org.bukkit.entity.Player player) Evaluates whether the player currently meets the conditions of this criterion. This is typically used for continuous or state-based checks.- 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.
-