Package de.Keyle.MyPet.api.event
package de.Keyle.MyPet.api.event
Bukkit events fired across a pet's lifecycle.
Events cover the whole arc of a pet: creation and removal, activation and deactivation, being called into the world and sent away, experience and level changes, combat, feeding, inventory access, naming, sitting and saving. Each class documents when it fires, whether it can be cancelled, and which of its siblings bracket it.
These are ordinary Bukkit events, so register a listener as usual. Watch the pet-state
note on each event: some fire while the pet is still a
StoredPet and expose no live Bukkit entity, so the entity
is only safe to touch on events that say the pet is live.
-
ClassDescriptionBase of every
PetEventthat listeners may veto.Fired after a pet has finished transitioning from at-rest (PersistedPet) to live (Pet) — i.e., once the runtime entity exists, all skills are registered and rebuilt from persisted state, and the pet is in the active-pets map.Fired when an owner attempts to spawn the world entity for an already-active pet — i.e.Fired when a brand-new pet is created and assigned to an owner — the moment a pet first enters the repository.How a pet came to be created.Fired before a pet deals mêlée damage to a target.Common base of every MyPet event that concerns one specific pet.Fired when a pet's saturation drops to zero — the pet is hungry and would otherwise begin losing health.Fired before a pet's experience changes — gain or loss.Fired when an owner right-clicks a pet with a foodItemStack.The visual and audible reaction a feed produces.Base class for pet right-click interaction events.Fired when something interacts with a pet's Backpack inventory.What is being done to the backpack.Fired after an experience change pushes a pet's level down — the symmetric counterpart ofPetLevelUpEvent.Common parent for level-transition events.Fired after an experience change pushes a pet's level up.Fired when the repository hands a stored pet toPetManagerfor activation — i.e., just before the manager wires it up as a livePet.Fired when a pet's display name is about to change.Fired before a pet's on-hit skill executes against a living target.Fired when a pet with the Pickup skill is about to grab anItementity off the ground.Fired after aMyPetPlayerhas finished joining the server — i.e., after the vanillaPlayerJoinEventfires AND after MyPet has loaded the player's pet roster from the repository, applied any pet-related tracking (lastSeentimestamp, default-pet activation, etc.), and registered them in the active player map.Fired when a pet is being permanently removed from the repository — the symmetric counterpart toPetCreateEvent.How a pet came to be removed.Fired when a pet's persisted state is being written to the repository.Fired when a pet has a skilltree assigned.How a skilltree came to be assigned.Fired when an owner runs/mypet sendaway— the symmetric counterpart ofPetCallEvent.Fired when a pet's sit / follow toggle is about to flip.The state a sit toggle switches the pet into.Fired when a pet's lifecyclePetStatetransitions — e.g., fromHere(entity in the world) toDespawned(entity removed but pet still active) or toDead(post-death respawn timer).