Package de.Keyle.MyPet.api.event
Class PetPickupItemEvent
java.lang.Object
org.bukkit.event.Event
de.Keyle.MyPet.api.event.PetEvent
de.Keyle.MyPet.api.event.CancellablePetEvent
de.Keyle.MyPet.api.event.PetPickupItemEvent
- All Implemented Interfaces:
Cancellable
Fired when a pet with the Pickup skill is about to grab an
Item
entity off the ground. Listeners receive the live world Item entity
before it is despawned and inserted into the pet's backpack.
Fires from PickupImpl during the proximity scan that runs every
Pickup tick, once per item entity that passes the skill's filter — distance,
cooldown, item-type allow/blocklist.
Cancellable: cancellation leaves the Item on the ground
and aborts the pickup. The pet won't re-attempt the same item until the
Pickup tick comes back around.
Pet state: live pet, with the owner online
Related events: PetInventoryActionEvent fires immediately
after this on the PetInventoryActionEvent.Action.PICKUP branch,
with the same can-cancel semantics. Listen here for per-item filtering and
to that event for per-action veto control.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.bukkit.event.Event
Event.Result -
Constructor Summary
ConstructorsConstructorDescriptionPetPickupItemEvent(Pet pet, Item item) Creates the event for a pending item pickup. -
Method Summary
Modifier and TypeMethodDescriptionstatic HandlerListReturns the handler list for this event type.getItem()The ground item entity, still in the world and not yet despawned.getPet()The pet about to pick the item up.Methods inherited from class de.Keyle.MyPet.api.event.CancellablePetEvent
isCancelled, setCancelledMethods inherited from class org.bukkit.event.Event
callEvent, getEventName, isAsynchronous
-
Constructor Details
-
PetPickupItemEvent
Creates the event for a pending item pickup.- Parameters:
pet- the pet performing the pickupitem- the ground item it is about to grab
-
-
Method Details
-
getHandlerList
Returns the handler list for this event type.- Returns:
- the shared
HandlerListeveryPetPickupItemEventis dispatched through
-
getHandlers
- Specified by:
getHandlersin classEvent
-
getPet
The pet about to pick the item up. -
getItem
The ground item entity, still in the world and not yet despawned.- Returns:
- the ground item it is about to grab
-