Class POISON
POISON applies Minecraft's POISON potion effect to inflict periodic damage to the target player. The poison damage diminishes the player's health over time but stops before killing them (damage is reduced when the player reaches critical health). The effect is powered by the Minecraft potion effect system with strength (amplifier) set to 1, determining the poison intensity. The effect is detectable by both mind-reading spells (Legilimens) and information spells (Informous) which report the target "feels sick".
- See Also:
-
Field Summary
Fields inherited from class net.pottercraft.ollivanders2.effect.O2Effect
affectedPlayerText, duration, effectType, informousText, kill, legilimensText, p, permanent, targetID -
Constructor Summary
ConstructorsConstructorDescriptionPOISON(@NotNull Ollivanders2 plugin, int duration, boolean isPermanent, @NotNull UUID pid) Constructor for creating a poison potion effect. -
Method Summary
Modifier and TypeMethodDescriptionvoiddoRemove()Perform cleanup when the poison 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
-
POISON
public POISON(@NotNull @NotNull Ollivanders2 plugin, int duration, boolean isPermanent, @NotNull @NotNull UUID pid) Constructor for creating a poison potion effect.Creates a potion effect that inflicts poison damage to the target player using Minecraft's POISON potion effect type. Sets detection text for both mind-reading spells (Legilimens) and information spells (Informous) to "feels sick".
- 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 poison
-
-
Method Details
-
doRemove
public void doRemove()Perform cleanup when the poison effect is removed.The default implementation does nothing, as POISON is a potion effect whose effects are automatically managed by the Minecraft potion system. When the effect expires or is manually removed, the poison damage stops and the player's health remains at its current value.
-