Class HEAL
HEAL applies Minecraft's INSTANT_HEALTH potion effect to restore health to the target player. Unlike effects that restore health over time, HEAL delivers its healing instantly when applied. The effect is powered by the Minecraft potion effect system with strength (amplifier) set to 1, determining the healing magnitude. The effect is detectable by mind-reading spells (Legilimens) which report the target "feels healthy".
- See Also:
-
Field Summary
Fields inherited from class net.pottercraft.ollivanders2.effect.O2Effect
affectedPlayerText, duration, effectType, informousText, kill, legilimensText, p, permanent, targetID -
Constructor Summary
ConstructorsConstructorDescriptionHEAL(@NotNull Ollivanders2 plugin, int duration, boolean isPermanent, @NotNull UUID pid) Constructor for creating an instant healing potion effect. -
Method Summary
Modifier and TypeMethodDescriptionvoiddoRemove()Perform cleanup when the instant healing effect is removed.Methods inherited from class net.pottercraft.ollivanders2.effect.PotionEffectSuper
checkEffect, getPotionEffectType, getStrength, setPermanent, setStrengthMethods inherited from class net.pottercraft.ollivanders2.effect.O2Effect
age, getAffectedPlayerText, getInformousText, getLegilimensText, getMaxDuration, getMinDuration, getRemainingDuration, getTargetID, isKilled, isPermanent, kill
-
Constructor Details
-
HEAL
public HEAL(@NotNull @NotNull Ollivanders2 plugin, int duration, boolean isPermanent, @NotNull @NotNull UUID pid) Constructor for creating an instant healing potion effect.Creates a potion effect that restores health to the target player using Minecraft's INSTANT_HEALTH potion effect type. The effect is detected by information spells as the target "feels healthy".
- Parameters:
plugin- a callback to the MC pluginduration- the duration in ticks, snapped to min of 2 minutes, max of 5 minutesisPermanent- ignored - potion effects cannot be permanentpid- the unique ID of the player to heal
-
-
Method Details
-
doRemove
public void doRemove()Perform cleanup when the instant healing effect is removed.The default implementation does nothing, as INSTANT_HEALTH is an instant potion effect with no persistent state to clean up. The healing is applied immediately when the effect is created, so no additional cleanup is required on removal.
-