Class WATER_BREATHING


public class WATER_BREATHING extends PotionEffectSuper
Water breathing potion effect that allows the affected player to breathe underwater.

WATER_BREATHING applies Minecraft's WATER_BREATHING potion effect to allow the target player to breathe underwater without consuming their oxygen meter. The effect enables underwater respiration, allowing the player to explore aquatic environments indefinitely without taking drowning damage. The effect is powered by the Minecraft potion effect system with strength (amplifier) set to 1. The effect is detectable by both mind-reading spells (Legilimens) and information spells (Informous) which report the target "can breathe in water".

See Also:
  • Constructor Details

    • WATER_BREATHING

      public WATER_BREATHING(@NotNull @NotNull Ollivanders2 plugin, int duration, boolean isPermanent, @NotNull @NotNull UUID pid)
      Constructor for creating a water breathing effect.

      Creates a potion effect that allows the target player to breathe underwater using Minecraft's WATER_BREATHING potion effect type with strength 1. Sets detection text for both mind-reading spells (Legilimens) and information spells (Informous) to "can breathe in water".

      Parameters:
      plugin - a callback to the MC 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 grant water breathing
  • Method Details

    • doRemove

      public void doRemove()
      Perform cleanup when the water breathing effect is removed.

      The default implementation does nothing, as WATER_BREATHING is a potion effect whose effects are automatically managed by the Minecraft potion system. When the effect expires or is manually removed, the player's normal underwater respiration behavior returns.

      Specified by:
      doRemove in class O2Effect