public class TargetHitEvent extends ProjectileHitEvent implements Cancellable
Cancelling this event will stop the Target from emitting a redstone signal, and in the case that the shooter is a player, will stop them from receiving advancement criteria.
Event.Resultentity| Constructor and Description |
|---|
TargetHitEvent(@NotNull Projectile projectile,
@NotNull Block block,
@NotNull BlockFace blockFace,
int signalStrength) |
| Modifier and Type | Method and Description |
|---|---|
static @NotNull HandlerList |
getHandlerList() |
@NotNull HandlerList |
getHandlers() |
int |
getSignalStrength()
Gets the strength of the redstone signal to be emitted by the Target block
|
boolean |
isCancelled()
Gets the cancellation state of this event.
|
void |
setCancelled(boolean cancelled)
Whether to cancel the action that occurs when the projectile hits.
|
void |
setSignalStrength(int signalStrength)
Sets the strength of the redstone signal to be emitted by the Target block
|
getEntity, getHitBlock, getHitBlockFace, getHitEntitygetEntityTypecallEvent, getEventName, isAsynchronouspublic boolean isCancelled()
CancellableisCancelled in interface CancellableisCancelled in class ProjectileHitEventpublic void setCancelled(boolean cancelled)
ProjectileHitEventFireworkExplodeEvent).
setCancelled in interface CancellablesetCancelled in class ProjectileHitEventcancelled - true if you wish to cancel this event@NotNull public @NotNull HandlerList getHandlers()
getHandlers in class ProjectileHitEvent@NotNull public static @NotNull HandlerList getHandlerList()
public int getSignalStrength()
public void setSignalStrength(int signalStrength)
signalStrength - the strength of the redstone signal to be emittedCopyright © 2021. All rights reserved.