public class EntityShootBowEvent extends EntityEvent implements Cancellable
Event.Result
entity
Constructor and Description |
---|
EntityShootBowEvent(@NotNull LivingEntity shooter,
@Nullable ItemStack bow,
@NotNull Entity projectile,
float force)
Deprecated.
|
EntityShootBowEvent(@NotNull LivingEntity shooter,
@Nullable ItemStack bow,
@Nullable ItemStack consumable,
@NotNull Entity projectile,
@NotNull EquipmentSlot hand,
float force,
boolean consumeItem) |
EntityShootBowEvent(@NotNull LivingEntity shooter,
@Nullable ItemStack bow,
@NotNull ItemStack arrowItem,
@NotNull Entity projectile,
float force)
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
@NotNull ItemStack |
getArrowItem()
Deprecated.
|
@Nullable ItemStack |
getBow()
Gets the bow ItemStack used to fire the arrow.
|
@Nullable ItemStack |
getConsumable()
Get the ItemStack to be consumed in this event (if any).
|
boolean |
getConsumeArrow()
Deprecated.
|
@NotNull LivingEntity |
getEntity()
Returns the Entity involved in this event
|
float |
getForce()
Gets the force the arrow was launched with
|
@NotNull EquipmentSlot |
getHand()
Get the hand from which the bow was shot.
|
static @NotNull HandlerList |
getHandlerList() |
@NotNull HandlerList |
getHandlers() |
@NotNull 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(@NotNull Entity projectile)
Replaces the projectile which will be launched
|
boolean |
shouldConsumeItem()
Get whether or not the consumable item should be consumed in this event.
|
getEntityType
callEvent, getEventName, isAsynchronous
@Deprecated public EntityShootBowEvent(@NotNull @NotNull LivingEntity shooter, @Nullable @Nullable ItemStack bow, @NotNull @NotNull Entity projectile, float force)
@Deprecated public EntityShootBowEvent(@NotNull @NotNull LivingEntity shooter, @Nullable @Nullable ItemStack bow, @NotNull @NotNull ItemStack arrowItem, @NotNull @NotNull Entity projectile, float force)
@Deprecated public void setConsumeArrow(boolean consumeArrow)
@Deprecated public boolean getConsumeArrow()
@NotNull @Deprecated public @NotNull ItemStack getArrowItem()
@NotNull public @NotNull LivingEntity getEntity()
EntityEvent
getEntity
in class EntityEvent
@Nullable public @Nullable ItemStack getBow()
@Nullable public @Nullable ItemStack getConsumable()
@NotNull public @NotNull Entity getProjectile()
public void setProjectile(@NotNull @NotNull Entity projectile)
projectile
- the new projectile@NotNull public @NotNull 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()
Cancellable
isCancelled
in interface Cancellable
public void setCancelled(boolean cancel)
Cancellable
setCancelled
in interface Cancellable
cancel
- true if you wish to cancel this event@NotNull public @NotNull HandlerList getHandlers()
getHandlers
in class Event
@NotNull public static @NotNull HandlerList getHandlerList()
Copyright © 2021. All rights reserved.