Class BLINDNESS


public class BLINDNESS extends PotionEffectSuper
Effect that applies the Minecraft blindness potion effect, obscuring the player's vision.

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:
  • 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 plugin
      duration - the duration in ticks, snapped to min of 2 minutes, max of 5 minutes
      isPermanent - ignored - potion effects cannot be permanent
      pid - 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.

      Specified by:
      doRemove in class O2Effect