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 SummaryNested classes/interfaces inherited from class org.bukkit.event.EventEvent.Result
- 
Field SummaryFields inherited from class org.bukkit.event.entity.EntityEvententity
- 
Constructor SummaryConstructorsConstructorDescriptionEntityLoadCrossbowEvent(@NotNull LivingEntity entity, @Nullable ItemStack crossbow, @NotNull EquipmentSlot hand) 
- 
Method SummaryModifier 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.EntityEventgetEntityTypeMethods inherited from class org.bukkit.event.EventcallEvent, getEventName, isAsynchronous
- 
Constructor Details- 
EntityLoadCrossbowEventpublic EntityLoadCrossbowEvent(@NotNull @NotNull LivingEntity entity, @Nullable @Nullable ItemStack crossbow, @NotNull @NotNull EquipmentSlot hand) 
 
- 
- 
Method Details- 
getEntityDescription copied from class:EntityEventReturns the Entity involved in this event- Overrides:
- getEntityin class- EntityEvent
- Returns:
- Entity who is involved in this event
 
- 
getCrossbowGets the crossbowItemStackbeing loaded.- Returns:
- the crossbow involved in this event
 
- 
getHandGets the hand from which the crossbow was loaded.- Returns:
- the hand
 
- 
shouldConsumeItempublic boolean shouldConsumeItem()- Returns:
- should the itemstack be consumed
 
- 
setConsumeItempublic void setConsumeItem(boolean consume) - Parameters:
- consume- should the item be consumed
 
- 
isCancelledpublic 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 interface- Cancellable
- Returns:
- true if this event is cancelled
 
- 
setCancelledpublic 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 interface- Cancellable
- Parameters:
- cancel- true if you wish to cancel this event
 
- 
getHandlers- Specified by:
- getHandlersin class- Event
 
- 
getHandlerList
 
-