Cancellablepublic class EntityShootBowEvent extends EntityEvent implements Cancellable
Event.Resultentity| Constructor | Description |
|---|---|
EntityShootBowEvent(LivingEntity shooter,
ItemStack bow,
Entity projectile,
float force) |
Deprecated.
|
EntityShootBowEvent(LivingEntity shooter,
ItemStack bow,
ItemStack arrowItem,
Entity projectile,
float force) |
Deprecated.
|
EntityShootBowEvent(LivingEntity shooter,
ItemStack bow,
ItemStack consumable,
Entity projectile,
EquipmentSlot hand,
float force,
boolean consumeItem) |
| Modifier and Type | Method | Description |
|---|---|---|
ItemStack |
getArrowItem() |
Deprecated.
|
ItemStack |
getBow() |
Gets the bow ItemStack used to fire the arrow.
|
ItemStack |
getConsumable() |
Get the ItemStack to be consumed in this event (if any).
|
boolean |
getConsumeArrow() |
Deprecated.
|
LivingEntity |
getEntity() |
Returns the Entity involved in this event
|
float |
getForce() |
Gets the force the arrow was launched with
|
EquipmentSlot |
getHand() |
Get the hand from which the bow was shot.
|
static HandlerList |
getHandlerList() |
|
HandlerList |
getHandlers() |
|
Entity |
getProjectile() |
Gets the projectile which will be launched by this event
|
boolean |
isCancelled() |
Gets the cancellation state of this event.
|
void |
setCancelled(boolean cancel) |
Sets the cancellation state of this event.
|
void |
setConsumeArrow(boolean consumeArrow) |
Deprecated.
|
void |
setConsumeItem(boolean consumeItem) |
Set whether or not the consumable item should be consumed in this event.
|
void |
setProjectile(Entity projectile) |
Replaces the projectile which will be launched
|
boolean |
shouldConsumeItem() |
Get whether or not the consumable item should be consumed in this event.
|
getEntityTypecallEvent, getEventName, isAsynchronous@Deprecated public EntityShootBowEvent(@NotNull LivingEntity shooter, @Nullable ItemStack bow, @NotNull Entity projectile, float force)
@Deprecated public EntityShootBowEvent(@NotNull LivingEntity shooter, @Nullable ItemStack bow, @NotNull ItemStack arrowItem, @NotNull Entity projectile, float force)
public EntityShootBowEvent(@NotNull LivingEntity shooter, @Nullable ItemStack bow, @Nullable ItemStack consumable, @NotNull Entity projectile, @NotNull EquipmentSlot hand, float force, boolean consumeItem)
@Deprecated public void setConsumeArrow(boolean consumeArrow)
@Deprecated public boolean getConsumeArrow()
@NotNull @Deprecated public ItemStack getArrowItem()
@NotNull public LivingEntity getEntity()
EntityEventgetEntity in class EntityEvent@Nullable public ItemStack getBow()
@Nullable public ItemStack getConsumable()
@NotNull public Entity getProjectile()
public void setProjectile(@NotNull Entity projectile)
projectile - the new projectile@NotNull public EquipmentSlot getHand()
public float getForce()
public void setConsumeItem(boolean consumeItem)
Player.updateInventory() is made as the client may disagree with
the server's decision to not consume a consumable item.
This value is ignored for entities where items are not required (skeletons, pillagers, etc.) or with crossbows (as no item is being consumed).
consumeItem - whether or not to consume the itempublic boolean shouldConsumeItem()
public boolean isCancelled()
CancellableisCancelled in interface Cancellablepublic void setCancelled(boolean cancel)
CancellablesetCancelled in interface Cancellablecancel - true if you wish to cancel this event@NotNull public HandlerList getHandlers()
getHandlers in class Event@NotNull public static HandlerList getHandlerList()
Copyright © 2021. All rights reserved.