Class HARM
HARM applies Minecraft's INSTANT_DAMAGE potion effect to inflict sudden damage to the target player. Unlike the BURNING effect which inflicts periodic damage over time, HARM delivers its damage instantly when applied. The effect is powered by the Minecraft potion effect system with strength (amplifier) set to 1, determining the damage magnitude. The effect is detectable by mind-reading spells (Legilimens) which report the target "feels unwell".
- See Also:
-
Field Summary
Fields inherited from class net.pottercraft.ollivanders2.effect.O2Effect
affectedPlayerText, duration, effectType, informousText, kill, legilimensText, p, permanent, targetID -
Constructor Summary
ConstructorsConstructorDescriptionHARM(@NotNull Ollivanders2 plugin, int duration, boolean isPermanent, @NotNull UUID pid) Constructor for creating an instant damage potion effect. -
Method Summary
Modifier and TypeMethodDescriptionvoiddoRemove()Perform cleanup when the instant damage 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
-
HARM
public HARM(@NotNull @NotNull Ollivanders2 plugin, int duration, boolean isPermanent, @NotNull @NotNull UUID pid) Constructor for creating an instant damage potion effect.Creates a potion effect that applies instant damage to the target player using Minecraft's INSTANT_DAMAGE potion effect type. The effect is detected by information spells as the target "feels unwell".
- 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 harm
-
-
Method Details
-
doRemove
public void doRemove()Perform cleanup when the instant damage effect is removed.The default implementation does nothing, as INSTANT_DAMAGE is an instant potion effect with no persistent state to clean up. The damage is applied immediately when the effect is created, so no additional cleanup is required on removal.
-