Class TargetHitEvent

All Implemented Interfaces:
Cancellable

@NullMarked public class TargetHitEvent extends ProjectileHitEvent
Called when a Target Block is hit by a projectile.

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.

  • Constructor Details

  • Method Details

    • getSignalStrength

      public @org.jetbrains.annotations.Range(from=0L, to=15L) int getSignalStrength()
      Gets the strength of the redstone signal to be emitted by the Target block
      Returns:
      the strength of the redstone signal to be emitted
    • setSignalStrength

      public void setSignalStrength(@org.jetbrains.annotations.Range(from=0L, to=15L) int signalStrength)
      Sets the strength of the redstone signal to be emitted by the Target block
      Parameters:
      signalStrength - the strength of the redstone signal to be emitted
    • getHandlers

      public HandlerList getHandlers()
      Overrides:
      getHandlers in class ProjectileHitEvent
    • getHandlerList

      public static HandlerList getHandlerList()