Package de.Keyle.MyPet.api.event
Class PetCallEvent
java.lang.Object
org.bukkit.event.Event
de.Keyle.MyPet.api.event.PetEvent
de.Keyle.MyPet.api.event.CancellablePetEvent
de.Keyle.MyPet.api.event.PetCallEvent
- All Implemented Interfaces:
Cancellable
Fired when an owner attempts to spawn the world entity for an already-active
pet — i.e.
/mypet call or any equivalent call to Pet#createEntity.
Fires once per call attempt, before the vanilla Mob is spawned.
The pet exposed via getPet() is already active (skills loaded,
NBT applied) — only the world entity is missing. Activation itself is signaled
separately by PetActivatedEvent, which fires earlier and only once
per session.
Cancellable: cancelling the event blocks the spawn, and the call attempt fails silently from the caller's perspective. Common addon use-cases: region-based call restrictions (WorldGuard / Towny integrations) and per-pet cooldown enforcement.
Pet state: always a live Pet — the pet is active but
its world entity has not yet been spawned.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.bukkit.event.Event
Event.Result -
Constructor Summary
ConstructorsConstructorDescriptionPetCallEvent(Pet pet) Creates the event for a pet whose world entity is about to be spawned. -
Method Summary
Modifier and TypeMethodDescriptionstatic HandlerListReturns the handler list for this event type.getPet()The active pet whose world entity is about to be spawned.Methods inherited from class de.Keyle.MyPet.api.event.CancellablePetEvent
isCancelled, setCancelledMethods inherited from class org.bukkit.event.Event
callEvent, getEventName, isAsynchronous
-
Constructor Details
-
PetCallEvent
Creates the event for a pet whose world entity is about to be spawned.- Parameters:
pet- the active pet being called into the world
-
-
Method Details
-
getHandlerList
Returns the handler list for this event type.- Returns:
- the shared
HandlerListeveryPetCallEventis dispatched through
-
getHandlers
- Specified by:
getHandlersin classEvent
-
getPet
The active pet whose world entity is about to be spawned.
-