Package de.Keyle.MyPet.api.entity
Interface PetWaterSensitive
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.
-
Nested Class Summary
Nested classes/interfaces inherited from interface de.Keyle.MyPet.api.entity.Pet
Pet.PetState, Pet.SpawnFlags -
Method Summary
Modifier and TypeMethodDescriptiondefault booleanWhether MyPet stops water and rain hurting this pet.Methods inherited from interface de.Keyle.MyPet.api.entity.Pet
autoAssignSkilltree, callToOwner, canMove, consumePendingSnapshot, createEntity, createEntity, decreaseSaturation, forgetTarget, getBukkitEntity, getCachedStatus, getDamage, getExperience, getLocation, getMaxHealth, getPetNavigation, getPetTarget, getRangedDamage, getSkills, getStatus, getTargetPriority, hasPetRider, hasTarget, hidePotionParticles, isHostAwaitingAdoption, isPassive, isSitting, makeSound, onInteract, onMeleeHitLanded, removeEntity, removePet, removePet, sendAway, setBukkitEntity, setExp, setHealth, setHostAwaitingAdoption, setLastUsed, setLocation, setMaxDistanceStep, setMinDistanceStep, setOwner, setPetName, setPetType, setRespawnTime, setSaturation, setSitting, setSkilltree, setSkilltree, setStatus, setTarget, setTarget, setUUID, setVolume, setWantsToRespawn, setWorldGroup, showPotionParticles, tickRespawnTimer, updateNameTag, updateVisualsMethods inherited from interface de.Keyle.MyPet.api.entity.StoredPet
getDisplayName, getExp, getHealth, getLastUsed, getLevel, getMaxDistanceStep, getMinDistanceStep, getOwner, getPetName, getPetType, getRespawnTime, getSaturation, getSkilltree, getUUID, getVolume, getWorldGroup, skillState, wantsToRespawn
-
Method Details
-
preventWaterDamage
default boolean preventWaterDamage()Whether MyPet stops water and rain hurting this pet.- Returns:
trueto suppress water damage
-