Class PotionEffectReward

java.lang.Object
com.github.darksoulq.abyssallib.world.advancement.reward.PotionEffectReward
All Implemented Interfaces:
AdvancementReward

public class PotionEffectReward extends Object implements AdvancementReward
An advancement reward that applies a specific status effect to the player.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    The codec used for serializing and deserializing the potion effect reward.
    The registered type definition for the potion effect reward.
  • Constructor Summary

    Constructors
    Constructor
    Description
    PotionEffectReward(org.bukkit.potion.PotionEffect effect)
    Constructs a new PotionEffectReward.
  • Method Summary

    Modifier and Type
    Method
    Description
    Retrieves the reward type definition associated with this instance.
    void
    grant(org.bukkit.entity.Player player)
    Applies the configured potion effect to the player.

    Methods inherited from class Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • CODEC

      public static final Codec<PotionEffectReward> CODEC
      The codec used for serializing and deserializing the potion effect reward.
    • TYPE

      public static final RewardType<PotionEffectReward> TYPE
      The registered type definition for the potion effect reward.
  • Constructor Details

    • PotionEffectReward

      public PotionEffectReward(org.bukkit.potion.PotionEffect effect)
      Constructs a new PotionEffectReward.
      Parameters:
      effect - The potion effect to apply.
  • Method Details

    • getType

      public RewardType<?> getType()
      Description copied from interface: AdvancementReward
      Retrieves the reward type definition associated with this instance. This is used to identify the logic and handle polymorphic serialization.
      Specified by:
      getType in interface AdvancementReward
      Returns:
      The RewardType characterizing this specific reward.
    • grant

      public void grant(org.bukkit.entity.Player player)
      Applies the configured potion effect to the player.
      Specified by:
      grant in interface AdvancementReward
      Parameters:
      player - The player receiving the reward.