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