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 SummaryNested classes/interfaces inherited from class org.bukkit.event.EventEvent.Result
- 
Field SummaryFields inherited from class org.bukkit.event.entity.EntityEvententity
- 
Constructor SummaryConstructorsConstructorDescriptionTargetHitEvent(Projectile projectile, Block block, BlockFace blockFace, int signalStrength) 
- 
Method SummaryModifier and TypeMethodDescriptionstatic HandlerList@org.jetbrains.annotations.Range(from=0L, to=15L) intGets the strength of the redstone signal to be emitted by the Target blockvoidsetSignalStrength(@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.ProjectileHitEventgetEntity, getHitBlock, getHitBlockFace, getHitEntity, isCancelled, setCancelledMethods inherited from class org.bukkit.event.entity.EntityEventgetEntityTypeMethods inherited from class org.bukkit.event.EventcallEvent, getEventName, isAsynchronous
- 
Constructor Details- 
TargetHitEvent@Internal public TargetHitEvent(Projectile projectile, Block block, BlockFace blockFace, int signalStrength) 
 
- 
- 
Method Details- 
getSignalStrengthpublic @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
 
- 
setSignalStrengthpublic 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:
- getHandlersin class- ProjectileHitEvent
 
- 
getHandlerList
 
-