Package de.Keyle.MyPet.api.entity
Interface PetSwimmingEntity
- All Known Subinterfaces:
PetAmphibiousEntity,PetAquaticEntity
Marker for pet types whose underlying vanilla mob can swim — implies
MyPet's movement layer should treat the pet as a swimmer when it's in
water (aquatic follow path, no float goal). Read at runtime by
PetType.isSwimmingPet() via Class.isAssignableFrom.
This is the swim-physics base; concrete pets implement one of the two sub-markers depending on their out-of-water survival semantics:
PetAquaticEntity— water-breathers that suffocate on land (fish, squids, guardians, dolphin, tadpole)PetAmphibiousEntity— pets that swim but also survive on land indefinitely (axolotl, drowned, frog, turtle)
The canSwim() default consults the per-pet preference loaded
from MyPet.Pets.<Type>.CanSwim in pet-config.yml. The YAML
row is auto-registered for every type that implements this marker — adding
a new swimming pet only requires implementing one of the sub-markers.
Provides a swim-base (this) plus a stricter PetAquaticEntity
sub-marker for the survival-affecting variant.
-
Nested Class Summary
Nested classes/interfaces inherited from interface de.Keyle.MyPet.api.entity.Pet
Pet.PetState, Pet.SpawnFlags -
Method Summary
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
-
canSwim
default boolean canSwim()Whether this pet may currently swim.- Returns:
trueif swimming is enabled for it
-