Class StatisticCriterion

java.lang.Object
com.github.darksoulq.abyssallib.world.advancement.criterion.StatisticCriterion
All Implemented Interfaces:
AdvancementCriterion

public class StatisticCriterion extends Object implements AdvancementCriterion
An advancement criterion evaluating a standard vanilla Minecraft statistic.
  • Field Details

    • CODEC

      public static final Codec<StatisticCriterion> CODEC
      The codec used for serializing and deserializing the vanilla statistic criterion.
    • TYPE

      public static final CriterionType<StatisticCriterion> TYPE
      The registered type definition for the vanilla statistic criterion.
  • Constructor Details

    • StatisticCriterion

      public StatisticCriterion(org.bukkit.Statistic statistic, int threshold)
      Constructs a new StatisticCriterion.
      Parameters:
      statistic - The vanilla statistic to track.
      threshold - The required value threshold.
  • Method Details

    • getType

      public CriterionType<?> getType()
      Description copied from interface: AdvancementCriterion
      Retrieves the type definition associated with this specific criterion instance.
      Specified by:
      getType in interface AdvancementCriterion
      Returns:
      The CriterionType characterizing this instance.
    • isMet

      public boolean isMet(org.bukkit.entity.Player player)
      Checks if the player's vanilla statistic value meets or exceeds the required threshold.
      Specified by:
      isMet in interface AdvancementCriterion
      Parameters:
      player - The player to evaluate.
      Returns:
      True if the condition is met.