Interface PetSwimmingEntity

All Superinterfaces:
Pet, Scheduler, StoredPet
All Known Subinterfaces:
PetAmphibiousEntity, PetAquaticEntity

public interface PetSwimmingEntity extends Pet
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.

  • Method Details

    • canSwim

      default boolean canSwim()
      Whether this pet may currently swim.
      Returns:
      true if swimming is enabled for it