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