Class ProjectileEvent
java.lang.Object
org.bukkit.event.Event
org.bukkit.event.entity.EntityEvent
me.deecaad.weaponmechanics.weapon.weaponevents.WeaponEvent
me.deecaad.weaponmechanics.weapon.weaponevents.ProjectileEvent
- Direct Known Subclasses:
ProjectileEndEvent,ProjectileExplodeEvent,ProjectileHitBlockEvent,ProjectileHitEntityEvent,ProjectilePreExplodeEvent
This class outlines convenient methods for any
WeaponEvent that involves an
WeaponProjectile.-
Nested Class Summary
Nested classes/interfaces inherited from class org.bukkit.event.Event
org.bukkit.event.Event.Result -
Field Summary
FieldsFields inherited from class me.deecaad.weaponmechanics.weapon.weaponevents.WeaponEvent
weaponTitleFields inherited from class org.bukkit.event.entity.EntityEvent
entity -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.bukkit.LocationReturns the location of the projectile before it's most recent tick.org.bukkit.LocationReturns the current location of the projectile.Returns the projectile involved in this event.org.bukkit.inventory.ItemStackReturns the weapon item which caused the event.Methods 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, getHandlers, isAsynchronous
-
Field Details
-
projectile
-
-
Constructor Details
-
ProjectileEvent
-
-
Method Details
-
getProjectile
Returns the projectile involved in this event.- Returns:
- The non-null projectile.
-
getWeaponStack
@Nullable public org.bukkit.inventory.ItemStack getWeaponStack()Returns the weapon item which caused the event. This should always be an item in the player's main hand, or off hand. If API is used to shoot projectile this will be null.- Overrides:
getWeaponStackin classWeaponEvent- Returns:
- The nullable weapon item.
-
getLocation
public org.bukkit.Location getLocation()Returns the current location of the projectile.- Returns:
- The non-null location of the projectile
-
getLastLocation
public org.bukkit.Location getLastLocation()Returns the location of the projectile before it's most recent tick.- Returns:
- The non-null location the projectile was 1 tick ago.
-