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 Type
    Method
    Description
    Retrieves the type definition associated with this specific criterion instance.
    boolean
    isMet(org.bukkit.entity.Player player)
    Evaluates whether the player currently meets the conditions of this criterion.
    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.
  • 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 CriterionType characterizing 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 - The Player to 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 - The Player involved in the event.
      event - The Event that triggered this evaluation.
      Returns:
      True if the event satisfies the criterion requirements.