Package de.Keyle.MyPet.api.entity
Interface PetAquaticEntity
- All Superinterfaces:
Pet,PetSwimmingEntity,Scheduler,StoredPet
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.
-
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 this pet drowning when it is out of water.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.PetSwimmingEntity
canSwimMethods 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
-
preventSuffocation
default boolean preventSuffocation()Whether MyPet stops this pet drowning when it is out of water.- Returns:
trueto suppress air-exposure damage
-