Class BLINDNESS
The BLINDNESS effect applies Minecraft's native BLINDNESS potion effect to the target player, simulating magical blinding that obscures their visual perception. This effect inherits from PotionEffectSuper and uses the randomized duration mechanism where the actual duration applied is calculated as: baseTime × random multiplier (between 1-5).
Mechanism:
- Applies Minecraft PotionEffectType.BLINDNESS to the player
- Strength set to 1 (full blindness amplifier)
- Duration randomized: baseTime × (random 1-5 multiplier)
- Detectable by both information spells (Informous) and mind-reading spells (Legilimens)
- Detection text: "cannot see"
- See Also:
-
Field Summary
Fields inherited from class net.pottercraft.ollivanders2.effect.O2Effect
affectedPlayerText, duration, effectType, informousText, kill, legilimensText, p, permanent, targetID -
Constructor Summary
ConstructorsConstructorDescriptionBLINDNESS(@NotNull Ollivanders2 plugin, int duration, boolean isPermanent, @NotNull UUID pid) Constructor for creating a blindness potion effect. -
Method Summary
Modifier and TypeMethodDescriptionvoiddoRemove()Perform cleanup when the blindness 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
-
BLINDNESS
public BLINDNESS(@NotNull @NotNull Ollivanders2 plugin, int duration, boolean isPermanent, @NotNull @NotNull UUID pid) Constructor for creating a blindness potion effect.Creates an effect that applies the Minecraft BLINDNESS potion effect to the target player. The duration parameter is used as the base time; the actual duration applied will be randomized by the parent class (baseTime × random multiplier between 1-5). Sets strength to 1 for full blindness amplification and detection text to "cannot see".
- Parameters:
plugin- a callback to the 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 blind
-
-
Method Details
-
doRemove
public void doRemove()Perform cleanup when the blindness effect is removed.The default implementation does nothing, as potion effect removal is handled by the parent class (PotionEffectSuper). When this effect is removed, the BLINDNESS potion effect is automatically stripped from the player by the parent class.
-