Class EntityKilledCriterion
java.lang.Object
com.github.darksoulq.abyssallib.world.advancement.criterion.EntityKilledCriterion
- All Implemented Interfaces:
AdvancementCriterion
An advancement criterion tracking the amount of a specific entity type killed by the player.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Codec<EntityKilledCriterion> The codec used for serializing and deserializing the entity killed criterion.static final CriterionType<EntityKilledCriterion> The registered type definition for the entity killed criterion. -
Constructor Summary
ConstructorsConstructorDescriptionEntityKilledCriterion(net.kyori.adventure.key.Key entityId, int amount) Constructs a new EntityKilledCriterion. -
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 entity killed criterion. -
TYPE
The registered type definition for the entity killed criterion.
-
-
Constructor Details
-
EntityKilledCriterion
public EntityKilledCriterion(net.kyori.adventure.key.Key entityId, int amount) Constructs a new EntityKilledCriterion.- Parameters:
entityId- The key of the entity to track.amount- The amount required.
-
-
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 has killed the required amount of the target entity.- Specified by:
isMetin interfaceAdvancementCriterion- Parameters:
player- The player to evaluate.- Returns:
- True if the condition is met.
-