Class CustomStatisticCriterion

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

public class CustomStatisticCriterion extends Object implements AdvancementCriterion
An advancement criterion evaluating a custom statistic tracked in the AbyssalLib database.
  • Field Details

  • Constructor Details

    • CustomStatisticCriterion

      public CustomStatisticCriterion(Statistic stat, int threshold)
      Constructs a new CustomStatisticCriterion.
      Parameters:
      stat - The statistic to track.
      threshold - The required value.
  • Method Details

    • getType

      public CriterionType<?> getType()
      Description copied from interface: AdvancementCriterion
      Retrieves the type definition associated with this specific criterion instance. This is used for identifying the logic and serialization codec.
      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 has accumulated the required statistic amount.
      Specified by:
      isMet in interface AdvancementCriterion
      Parameters:
      player - The player to evaluate.
      Returns:
      True if the condition is met.