Interface PetAquaticEntity

All Superinterfaces:
Pet, PetSwimmingEntity, Scheduler, StoredPet

public interface PetAquaticEntity extends PetSwimmingEntity
Marker for pet types whose underlying vanilla mob is a strict water-breather — swims naturally and takes vanilla drown-type damage when exposed to air. The cohort that extends Mojang's WaterMob (fish, squids, guardians, dolphin) plus Tadpole (which uses the same out-of-water suffocation tick).

Sibling to PetAmphibiousEntity under the shared PetSwimmingEntity base. The swim physics gate (`canSwim()`) is inherited from the base; this marker adds the suffocation gate.

The preventSuffocation() default consults the per-pet preference loaded from MyPet.Pets.<Type>.PreventSuffocation in pet-config.yml. The YAML row is auto-registered for every type that implements this marker. Wiring lives in PetSurvivalListener's EntityDamageEvent arm: when the flag is true both DamageCause.DRYOUT (the out-of-water case vanilla actually raises for water-breathers) and DamageCause.DROWNING are canceled for marked pets.

  • Method Details

    • preventSuffocation

      default boolean preventSuffocation()
      Whether MyPet stops this pet drowning when it is out of water.
      Returns:
      true to suppress air-exposure damage