Cancellable
public class PlayerLaunchProjectileEvent extends PlayerEvent implements Cancellable
Event.Result
player
Constructor | Description |
---|---|
PlayerLaunchProjectileEvent(@NotNull Player shooter,
@NotNull ItemStack itemStack,
@NotNull Projectile projectile) |
Modifier and Type | Method | Description |
---|---|---|
static @NotNull HandlerList |
getHandlerList() |
|
@NotNull HandlerList |
getHandlers() |
|
@NotNull ItemStack |
getItemStack() |
Get the ItemStack used to fire the projectile
|
@NotNull Projectile |
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 |
setShouldConsume(boolean consumeItem) |
Set whether to consume the ItemStack or not
|
boolean |
shouldConsume() |
Get whether to consume the ItemStack or not
|
callEvent, getEventName, isAsynchronous
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getPlayer
public PlayerLaunchProjectileEvent(@NotNull @NotNull Player shooter, @NotNull @NotNull ItemStack itemStack, @NotNull @NotNull Projectile projectile)
@NotNull public @NotNull Projectile getProjectile()
@NotNull public @NotNull ItemStack getItemStack()
public boolean shouldConsume()
public void setShouldConsume(boolean consumeItem)
consumeItem
- True to consumepublic 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 © 2020. All rights reserved.