Class StatisticCriterion
java.lang.Object
com.github.darksoulq.abyssallib.world.advancement.criterion.StatisticCriterion
- All Implemented Interfaces:
AdvancementCriterion
An advancement criterion evaluating a standard vanilla Minecraft statistic.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Codec<StatisticCriterion> The codec used for serializing and deserializing the vanilla statistic criterion.static final CriterionType<StatisticCriterion> The registered type definition for the vanilla statistic criterion. -
Constructor Summary
ConstructorsConstructorDescriptionStatisticCriterion(org.bukkit.Statistic statistic, int threshold) Constructs a new StatisticCriterion. -
Method Summary
Methods inherited from class Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface AdvancementCriterion
isMet
-
Field Details
-
CODEC
The codec used for serializing and deserializing the vanilla statistic criterion. -
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
Description copied from interface:AdvancementCriterionRetrieves the type definition associated with this specific criterion instance. This is used for identifying the logic and serialization codec.- Specified by:
getTypein interfaceAdvancementCriterion- Returns:
- The
CriterionTypecharacterizing 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:
isMetin interfaceAdvancementCriterion- Parameters:
player- The player to evaluate.- Returns:
- True if the condition is met.
-