Class PetCallEvent

All Implemented Interfaces:
Cancellable

public class PetCallEvent extends CancellablePetEvent
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.

  • Constructor Details

    • PetCallEvent

      public PetCallEvent(Pet pet)
      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

      public static HandlerList getHandlerList()
      Returns the handler list for this event type.
      Returns:
      the shared HandlerList every PetCallEvent is dispatched through
    • getHandlers

      public @NonNull HandlerList getHandlers()
      Specified by:
      getHandlers in class Event
    • getPet

      public Pet getPet()
      The active pet whose world entity is about to be spawned.
      Specified by:
      getPet in class PetEvent
      Returns:
      the pet being called into the world