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

public abstract class ProjectileEvent extends WeaponEvent
This class outlines convenient methods for any WeaponEvent that involves an WeaponProjectile.
  • Field Details

  • Constructor Details

  • Method Details

    • getProjectile

      public WeaponProjectile 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:
      getWeaponStack in class WeaponEvent
      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.