Class PotionEffectReward
java.lang.Object
com.github.darksoulq.abyssallib.world.advancement.reward.PotionEffectReward
- All Implemented Interfaces:
AdvancementReward
An advancement reward that applies a specific status effect to the player.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Codec<PotionEffectReward> The codec used for serializing and deserializing the potion effect reward.static final RewardType<PotionEffectReward> The registered type definition for the potion effect reward. -
Constructor Summary
ConstructorsConstructorDescriptionPotionEffectReward(org.bukkit.potion.PotionEffect effect) Constructs a new PotionEffectReward. -
Method Summary
Modifier and TypeMethodDescriptionRewardType<?> getType()Retrieves the reward type definition associated with this instance.voidgrant(org.bukkit.entity.Player player) Applies the configured potion effect to the player.
-
Field Details
-
CODEC
The codec used for serializing and deserializing the potion effect reward. -
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
Description copied from interface:AdvancementRewardRetrieves the reward type definition associated with this instance. This is used to identify the logic and handle polymorphic serialization.- Specified by:
getTypein interfaceAdvancementReward- Returns:
- The
RewardTypecharacterizing this specific reward.
-
grant
public void grant(org.bukkit.entity.Player player) Applies the configured potion effect to the player.- Specified by:
grantin interfaceAdvancementReward- Parameters:
player- The player receiving the reward.
-