Interface PetWaterSensitive

All Superinterfaces:
Pet, Scheduler, StoredPet

public interface PetWaterSensitive extends Pet
Marker for pet types whose underlying vanilla mob is hurt by water and rain — the cohort whose Mojang counterpart returns true from LivingEntity#isSensitiveToWater() (Enderman, Blaze, Snow Golem, Strider). Vanilla deals that damage with the drown damage type, which Bukkit reports as DamageCause.DROWNING.

The preventWaterDamage() default consults the per-pet preference loaded from MyPet.Pets.<Type>.PreventWaterDamage in pet-config.yml. Wiring lives in PetSurvivalListener: when the flag is true the DROWNING damage is canceled, and for Endermen the DROWN escape teleport Paper raises alongside it is canceled too, so the pet stays at its owner's side in the rain.

  • Method Details

    • preventWaterDamage

      default boolean preventWaterDamage()
      Whether MyPet stops water and rain hurting this pet.
      Returns:
      true to suppress water damage