Class WATER_BREATHING
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:
-
Field Summary
Fields inherited from class net.pottercraft.ollivanders2.effect.O2Effect
affectedPlayerText, duration, effectType, informousText, kill, legilimensText, p, permanent, targetID -
Constructor Summary
ConstructorsConstructorDescriptionWATER_BREATHING(@NotNull Ollivanders2 plugin, int duration, boolean isPermanent, @NotNull UUID pid) Constructor for creating a water breathing effect. -
Method Summary
Modifier and TypeMethodDescriptionvoiddoRemove()Perform cleanup when the water breathing 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
-
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 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 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.
-