Package de.Keyle.MyPet.api.behavior
Interface PetEventHandler<E extends Event>
- Type Parameters:
E- the Bukkit event type this handler accepts
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Functional handler invoked by the central dispatcher when a
Event
fires on a pet whose type matches a registered PetBehavior.
The handler receives the typed event plus the already-matched pet and
its live Bukkit Mob — no instanceof PetEntityMarker check,
no MyPetApi.getPetManager().getPetFromEntity(...) call, no class
cast. The dispatcher does all of that before invocation.
-
Method Summary
-
Method Details
-
accept
Handles one event on one pet. The dispatcher has already matched the pet type and resolved both the pet and its live mob.- Parameters:
event- the event that firedpet- the pet it concernsmob- that pet's live Bukkit mob
-