Package io.papermc.paper.event.block
Class TargetHitEvent
java.lang.Object
org.bukkit.event.Event
org.bukkit.event.entity.EntityEvent
org.bukkit.event.entity.ProjectileHitEvent
io.papermc.paper.event.block.TargetHitEvent
- All Implemented Interfaces:
Cancellable
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.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.bukkit.event.Event
Event.Result
-
Field Summary
Fields inherited from class org.bukkit.event.entity.EntityEvent
entity
-
Constructor Summary
ConstructorDescriptionTargetHitEvent
(Projectile projectile, Block block, BlockFace blockFace, int signalStrength) -
Method Summary
Modifier and TypeMethodDescriptionstatic HandlerList
@org.jetbrains.annotations.Range(from=0L, to=15L) int
Gets the strength of the redstone signal to be emitted by the Target blockvoid
setSignalStrength
(@org.jetbrains.annotations.Range(from=0L, to=15L) int signalStrength) Sets the strength of the redstone signal to be emitted by the Target blockMethods inherited from class org.bukkit.event.entity.ProjectileHitEvent
getEntity, getHitBlock, getHitBlockFace, getHitEntity, isCancelled, setCancelled
Methods inherited from class org.bukkit.event.entity.EntityEvent
getEntityType
Methods inherited from class org.bukkit.event.Event
callEvent, getEventName, isAsynchronous
-
Constructor Details
-
TargetHitEvent
@Internal public TargetHitEvent(Projectile projectile, Block block, BlockFace blockFace, int signalStrength)
-
-
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
- Overrides:
getHandlers
in classProjectileHitEvent
-
getHandlerList
-