Class ProjectileHitBlockEvent
java.lang.Object
org.bukkit.event.Event
org.bukkit.event.entity.EntityEvent
me.deecaad.weaponmechanics.weapon.weaponevents.WeaponEvent
me.deecaad.weaponmechanics.weapon.weaponevents.ProjectileEvent
me.deecaad.weaponmechanics.weapon.weaponevents.ProjectileHitBlockEvent
- All Implemented Interfaces:
org.bukkit.event.Cancellable
public class ProjectileHitBlockEvent
extends ProjectileEvent
implements org.bukkit.event.Cancellable
Called whenever a
WeaponProjectile hits a block. This may be called multiple times for
some projectiles (that use
Through or
Bouncy).
For more control over the projectile, consider using a
ProjectileScript instead.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.bukkit.event.Event
org.bukkit.event.Event.Result -
Field Summary
Fields inherited from class me.deecaad.weaponmechanics.weapon.weaponevents.ProjectileEvent
projectileFields inherited from class me.deecaad.weaponmechanics.weapon.weaponevents.WeaponEvent
weaponTitleFields inherited from class org.bukkit.event.entity.EntityEvent
entity -
Constructor Summary
ConstructorsConstructorDescriptionProjectileHitBlockEvent(WeaponProjectile projectile, org.bukkit.block.Block block, org.bukkit.block.BlockFace hitBlockFace, org.bukkit.util.Vector exactLocation) -
Method Summary
Modifier and TypeMethodDescriptionorg.bukkit.block.BlockgetBlock()Returns the block that was hit by the projectile.static org.bukkit.event.HandlerListorg.bukkit.event.HandlerListorg.bukkit.block.BlockFaceReturns the face of the block that was hit by the projectile.org.bukkit.LocationReturns the exact* location where the projectile's ray collides with the block's bounding box.booleanvoidsetCancelled(boolean cancelled) Methods inherited from class me.deecaad.weaponmechanics.weapon.weaponevents.ProjectileEvent
getLastLocation, getLocation, getProjectile, getWeaponStackMethods inherited from class me.deecaad.weaponmechanics.weapon.weaponevents.WeaponEvent
getHand, getHandData, getShooter, getShooterWrapper, getWeaponTitle, isMainHand, isOffHandMethods inherited from class org.bukkit.event.entity.EntityEvent
getEntity, getEntityTypeMethods inherited from class org.bukkit.event.Event
callEvent, getEventName, isAsynchronous
-
Constructor Details
-
ProjectileHitBlockEvent
public ProjectileHitBlockEvent(WeaponProjectile projectile, org.bukkit.block.Block block, org.bukkit.block.BlockFace hitBlockFace, org.bukkit.util.Vector exactLocation)
-
-
Method Details
-
getBlock
public org.bukkit.block.Block getBlock()Returns the block that was hit by the projectile.- Returns:
- The non-null bukkit block that was hit.
-
getHitFace
public org.bukkit.block.BlockFace getHitFace()Returns the face of the block that was hit by the projectile.- Returns:
- The non-null hit block face.
-
getHitLocation
public org.bukkit.Location getHitLocation()Returns the exact* location where the projectile's ray collides with the block's bounding box.- Returns:
- The non-null collision point
-
isCancelled
public boolean isCancelled()- Specified by:
isCancelledin interfaceorg.bukkit.event.Cancellable
-
setCancelled
public void setCancelled(boolean cancelled) - Specified by:
setCancelledin interfaceorg.bukkit.event.Cancellable
-
getHandlers
@NotNull public org.bukkit.event.HandlerList getHandlers()- Specified by:
getHandlersin classorg.bukkit.event.Event
-
getHandlerList
public static org.bukkit.event.HandlerList getHandlerList()
-