Class CustomAttributeCriterion
java.lang.Object
com.github.darksoulq.abyssallib.world.advancement.criterion.CustomAttributeCriterion
- All Implemented Interfaces:
AdvancementCriterion
An advancement criterion evaluating custom RPG attributes of a player.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Codec<CustomAttributeCriterion> The codec used for serializing and deserializing the custom attribute criterion.static final CriterionType<CustomAttributeCriterion> The registered type definition for the custom attribute criterion. -
Constructor Summary
ConstructorsConstructorDescriptionCustomAttributeCriterion(net.kyori.adventure.key.Key attrKey, double threshold) Constructs a new CustomAttributeCriterion. -
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 custom attribute criterion. -
TYPE
The registered type definition for the custom attribute criterion.
-
-
Constructor Details
-
CustomAttributeCriterion
public CustomAttributeCriterion(net.kyori.adventure.key.Key attrKey, double threshold) Constructs a new CustomAttributeCriterion.- Parameters:
attrKey- The key of the custom attribute.threshold- The required value.
-
-
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 custom attribute value meets or exceeds the threshold.- Specified by:
isMetin interfaceAdvancementCriterion- Parameters:
player- The player to evaluate.- Returns:
- True if the condition is met.
-