Package io.papermc.paper.event.entity
Class EntityLoadCrossbowEvent
java.lang.Object
org.bukkit.event.Event
org.bukkit.event.entity.EntityEvent
io.papermc.paper.event.entity.EntityLoadCrossbowEvent
- All Implemented Interfaces:
Cancellable
Called when a LivingEntity loads a crossbow with a projectile.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.bukkit.event.Event
Event.Result -
Field Summary
Fields inherited from class org.bukkit.event.entity.EntityEvent
entity -
Constructor Summary
ConstructorsConstructorDescriptionEntityLoadCrossbowEvent(@NotNull LivingEntity entity, @NotNull ItemStack crossbow, @NotNull EquipmentSlot hand) -
Method Summary
Modifier and TypeMethodDescriptionGets the crossbowItemStackbeing loaded.Returns the Entity involved in this eventgetHand()Gets the hand from which the crossbow was loaded.static @NotNull HandlerListbooleanGets the cancellation state of this event.voidsetCancelled(boolean cancel) Set whether or not to cancel the crossbow being loaded.voidsetConsumeItem(boolean consume) booleanMethods inherited from class org.bukkit.event.entity.EntityEvent
getEntityTypeMethods inherited from class org.bukkit.event.Event
callEvent, getEventName, isAsynchronous
-
Constructor Details
-
EntityLoadCrossbowEvent
@Internal public EntityLoadCrossbowEvent(@NotNull @NotNull LivingEntity entity, @NotNull @NotNull ItemStack crossbow, @NotNull @NotNull EquipmentSlot hand)
-
-
Method Details
-
getEntity
Description copied from class:EntityEventReturns the Entity involved in this event- Overrides:
getEntityin classEntityEvent- Returns:
- Entity who is involved in this event
-
getCrossbow
Gets the crossbowItemStackbeing loaded.- Returns:
- the crossbow involved in this event
-
getHand
Gets the hand from which the crossbow was loaded.- Returns:
- the hand
-
shouldConsumeItem
public boolean shouldConsumeItem()- Returns:
- should the itemstack be consumed
-
setConsumeItem
public void setConsumeItem(boolean consume) - Parameters:
consume- should the item be consumed
-
isCancelled
public boolean isCancelled()Description copied from interface:CancellableGets the cancellation state of this event. A cancelled event will not be executed in the server, but will still pass to other plugins- Specified by:
isCancelledin interfaceCancellable- Returns:
- true if this event is cancelled
-
setCancelled
public void setCancelled(boolean cancel) Set whether or not to cancel the crossbow being loaded. If canceled, the projectile that would be loaded into the crossbow will not be consumed.- Specified by:
setCancelledin interfaceCancellable- Parameters:
cancel- true if you wish to cancel this event
-
getHandlers
- Specified by:
getHandlersin classEvent
-
getHandlerList
-