Package de.Keyle.MyPet.api.entity
package de.Keyle.MyPet.api.entity
Pets in both their live and at-rest forms, plus the markers describing what a species can do.
A pet exists in two shapes. Pet is the live, in-world pet backed by a Bukkit
entity; StoredPet is the read-only view of a pet at rest, implemented by the
immutable PersistedPet record that the repository loads from disk. Code that runs
while a pet may be despawned should accept StoredPet.
PetType is the registry of every available species and PetInfo holds
its per-type metadata. The many PetXxx marker interfaces declare capabilities of
the underlying vanilla mob — whether it flies, swims, can be saddled, burns in sunlight,
converts under lightning — and the AI, leashing and skill layers branch on them instead
of on hard-coded species lists.
-
ClassDescriptionDeclares the out-of-box defaults for a pet type.Immutable, value-typed pet record — the canonical "pet at rest" representation that the repository loads from disk and that callers pass around between deactivation and reactivation.Step-by-step construction of a
PersistedPet, for callers setting more than one field.Active, in-world pet.Lifecycle state of a pet.Result codes returned byPet.createEntity().Marker for pet types whose underlying vanilla mob swims in water but also survives on land indefinitely — axolotl, drowned, frog, turtle.Marker for pet types whose underlying vanilla mob is a strict water-breather — swims naturally and takes vanilladrown-type damage when exposed to air.Marker for pet types that have a baby/adult form.Marker for pets that expose thechestcreation flag (gives the underlying mob a carried chest at spawn viaChestedHorse.setCarryingChest(boolean)).The per-pet distance formula, in one place.One pet's resolved thresholds, in blocks from the owner.Marker for pet types that can wear or hold equipment (armor, weapons, saddles).Marker for pet types whose underlying vanilla mob naturally flies — implies Pet's AI/movement layer should treat this pet as airborne (no gravity, flight pathing, no float goal).Per-type metadata registry.Marker for pet types whose underlying vanilla mob has a per-tick item-driven right-click interaction (cow + bucket → milk, sheep and shears → wool, etc.).Marker for pet types whose underlying vanilla mob is immune to lava and navigates through it naturally (Strider, all Nether skeletons, and Magma Cube).Marker for pet types that vanilla converts to a different species when struck by lightning (Pig → ZombifiedPiglin, Villager → Witch).Marker for pet types that vanilla matures into a different species once an internal age timer expires.Marker for pets that carry more than one rider in vanilla.Marker for pet types whose underlying vanilla mob has a periodic AI-tick item drop (chicken eggs, armadillo scutes, sniffer seeds, goat horns, panda baby slimeballs, ...).Marker for pets that can be mounted in vanilla Minecraft.Marker for pets that can be saddled in vanilla Minecraft, via any of the three Bukkit-API saddle shapes:SaddledMountInventory— inventory saddle slot (Horse, Donkey, Mule, SkeletonHorse, ZombieHorse, Camel, CamelHusk viaAbstractHorseInventory; Nautilus, ZombieNautilus viaArmoredSaddledMountInventory)Steerable— boolean saddle flag (Pig, Strider).Marker for pet types whose underlying vanilla mob has a sit animation — Wolf, Cat, Camel, Panda, Fox.Marker for pet types whose underlying vanilla mob combusts in direct sunlight — the cohort whose Mojang counterpart returnstruefromMob#isSunSensitive()(zombies, skeletons, and their variants) plus Phantom (which has its own sunlight check onaiStep).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).Marker for pets that expose thetamedcreation flag (sets the underlying mob'stamedstate to true at spawn).Registry of all available pet types.Marker for pet types whose underlying vanilla mob is hurt by water and rain — the cohort whose Mojang counterpart returnstruefromLivingEntity#isSensitiveToWater()(Enderman, Blaze, Snow Golem, Strider).Marker for nether-native pet types that vanilla converts to a zombified form when they spend too long in the Overworld (Hoglin → Zoglin, Piglin → ZombifiedPiglin, PiglinBrute → ZombifiedPiglin).Annotation to define shop information for a pet type.Read-only view of a pet at rest.