Class LevelCriterion
java.lang.Object
com.github.darksoulq.abyssallib.world.advancement.criterion.LevelCriterion
- All Implemented Interfaces:
AdvancementCriterion
An advancement criterion ensuring a player reaches a specified vanilla XP level.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Codec<LevelCriterion> The codec used for serializing and deserializing the level criterion.static final CriterionType<LevelCriterion> The registered type definition for the level criterion. -
Constructor Summary
Constructors -
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 level criterion. -
TYPE
The registered type definition for the level criterion.
-
-
Constructor Details
-
LevelCriterion
public LevelCriterion(int level) Constructs a new LevelCriterion.- Parameters:
level- The required vanilla XP level.
-
-
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 XP level meets or exceeds the required level.- Specified by:
isMetin interfaceAdvancementCriterion- Parameters:
player- The player to evaluate.- Returns:
- True if the condition is met.
-