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`

public class EntityLoadCrossbowEvent extends EntityEvent implements 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

Constructors
Constructor
Description
`EntityLoadCrossbowEvent(@NotNull LivingEntity entity, @Nullable ItemStack crossbow, @NotNull EquipmentSlot hand)`

## Method Summary

Modifier and Type
Method
Description
`@Nullable ItemStack`
`getCrossbow()`
Gets the crossbow `ItemStack` being loaded.
`@NotNull LivingEntity`
`getEntity()`
Returns the Entity involved in this event
`@NotNull EquipmentSlot`
`getHand()`
Gets the hand from which the crossbow was loaded.
`static @NotNull HandlerList`
`getHandlerList()`
`@NotNull HandlerList`
`getHandlers()`
`boolean`
`isCancelled()`
Gets the cancellation state of this event.
`void`
`setCancelled(boolean cancel)`
Set whether or not to cancel the crossbow being loaded.
`void`
`setConsumeItem(boolean consume)`
`boolean`
`shouldConsumeItem()`

### Methods inherited from class org.bukkit.event.entity.EntityEvent

`getEntityType`

### Methods inherited from class org.bukkit.event.Event

`callEvent, getEventName, isAsynchronous`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### EntityLoadCrossbowEvent

public EntityLoadCrossbowEvent(@NotNull @NotNull LivingEntity entity, @Nullable @Nullable ItemStack crossbow, @NotNull @NotNull EquipmentSlot hand)

## Method Details

### getEntity

@NotNull public @NotNull LivingEntity getEntity()
Description copied from class: `EntityEvent`
Returns the Entity involved in this event

Overrides:
  `getEntity` in class `EntityEvent`
Returns:
  Entity who is involved in this event

### getCrossbow

@Nullable public @Nullable ItemStack getCrossbow()
Gets the crossbow `ItemStack` being loaded.

Returns:
  the crossbow involved in this event

### getHand

@NotNull public @NotNull EquipmentSlot 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: `Cancellable`
Gets 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:
  `isCancelled` in interface `Cancellable`
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:
  `setCancelled` in interface `Cancellable`
Parameters:
  `cancel` - true if you wish to cancel this event

### getHandlers

@NotNull public @NotNull HandlerList getHandlers()

Specified by:
  `getHandlers` in class `Event`

### getHandlerList

@NotNull public static @NotNull HandlerList getHandlerList()