Class PotionEffectCriterion

java.lang.Object
com.github.darksoulq.abyssallib.world.advancement.criterion.PotionEffectCriterion
All Implemented Interfaces:
AdvancementCriterion

public class PotionEffectCriterion extends Object implements AdvancementCriterion
An advancement criterion ensuring a player currently has a specific potion effect active.
  • Field Details

  • Constructor Details

    • PotionEffectCriterion

      public PotionEffectCriterion(org.bukkit.potion.PotionEffectType effect)
      Constructs a new PotionEffectCriterion.
      Parameters:
      effect - The required potion effect type.
  • Method Details

    • getType

      public CriterionType<?> getType()
      Description copied from interface: AdvancementCriterion
      Retrieves the type definition associated with this specific criterion instance. This is used for identifying the logic and serialization codec.
      Specified by:
      getType in interface AdvancementCriterion
      Returns:
      The CriterionType characterizing this instance.
    • isMet

      public boolean isMet(org.bukkit.entity.Player player)
      Checks if the player currently has the target potion effect active.
      Specified by:
      isMet in interface AdvancementCriterion
      Parameters:
      player - The player to evaluate.
      Returns:
      True if the condition is met.