public class EntityLoadCrossbowEvent extends EntityEvent implements Cancellable
Event.Resultentity| Constructor and Description |
|---|
EntityLoadCrossbowEvent(@NotNull LivingEntity entity,
@Nullable ItemStack crossbow,
@NotNull EquipmentSlot hand) |
| Modifier and Type | Method and 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() |
getEntityTypecallEvent, getEventName, isAsynchronouspublic EntityLoadCrossbowEvent(@NotNull @NotNull LivingEntity entity, @Nullable @Nullable ItemStack crossbow, @NotNull @NotNull EquipmentSlot hand)
@NotNull public @NotNull LivingEntity getEntity()
EntityEventgetEntity in class EntityEvent@Nullable public @Nullable ItemStack getCrossbow()
ItemStack being loaded.@NotNull public @NotNull EquipmentSlot getHand()
public boolean shouldConsumeItem()
public void setConsumeItem(boolean consume)
consume - should the item be consumedpublic boolean isCancelled()
CancellableisCancelled in interface Cancellablepublic void setCancelled(boolean cancel)
Player.updateInventory() is made
as the client may think the server still loaded an item into the crossbow.setCancelled in interface Cancellablecancel - 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.