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.Result
entity
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, getHitEntity
getEntityType
callEvent, getEventName, isAsynchronous
public boolean isCancelled()
Cancellable
isCancelled
in interface Cancellable
isCancelled
in class ProjectileHitEvent
public void setCancelled(boolean cancelled)
ProjectileHitEvent
FireworkExplodeEvent
).
setCancelled
in interface Cancellable
setCancelled
in class ProjectileHitEvent
cancelled
- 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.