Class PrepareWeaponShootEvent

java.lang.Object
org.bukkit.event.Event
org.bukkit.event.entity.EntityEvent
me.deecaad.weaponmechanics.weapon.weaponevents.WeaponEvent
me.deecaad.weaponmechanics.weapon.weaponevents.PrepareWeaponShootEvent
All Implemented Interfaces:
org.bukkit.event.Cancellable

public class PrepareWeaponShootEvent extends WeaponEvent implements org.bukkit.event.Cancellable
This event is called after WeaponPreShootEvent but right before WeaponShootEvent. This can be used to modify mechanics, projectile amount, etc.
  • Constructor Details

    • PrepareWeaponShootEvent

      public PrepareWeaponShootEvent(@NotNull String weaponTitle, @NotNull org.bukkit.inventory.ItemStack weaponStack, @NotNull org.bukkit.entity.LivingEntity shooter, @NotNull org.bukkit.inventory.EquipmentSlot hand, @Nullable me.deecaad.core.mechanics.MechanicManager shootMechanics, boolean resetFallDistance, @Nullable Projectile projectile, double projectileSpeed, int projectileAmount, @Nullable Spread spread, @Nullable RecoilProfile recoil)
  • Method Details

    • getShootMechanics

      @Nullable public me.deecaad.core.mechanics.MechanicManager getShootMechanics()
    • setShootMechanics

      public void setShootMechanics(@Nullable me.deecaad.core.mechanics.MechanicManager shootMechanics)
    • isResetFallDistance

      public boolean isResetFallDistance()
    • setResetFallDistance

      public void setResetFallDistance(boolean resetFallDistance)
    • getProjectile

      @Nullable public Projectile getProjectile()
      The projectile launched, or null if the weapon doesn't shoot any projectiles.

      Consumables, like stims, don't shoot any projectiles.

      Returns:
      The projectile, or null if the weapon doesn't shoot any projectiles.
    • setProjectile

      public void setProjectile(@Nullable Projectile projectile)
    • getProjectileSpeed

      public double getProjectileSpeed()
    • setProjectileSpeed

      public void setProjectileSpeed(double projectileSpeed)
    • getProjectileAmount

      public int getProjectileAmount()
    • setProjectileAmount

      public void setProjectileAmount(int projectileAmount)
    • getSpread

      @Nullable public Spread getSpread()
    • setSpread

      public void setSpread(@Nullable Spread spread)
    • getBaseSpread

      public double getBaseSpread()
    • setBaseSpread

      public void setBaseSpread(double baseSpread)
    • getRecoil

      @Nullable public RecoilProfile getRecoil()
    • setRecoil

      public void setRecoil(@Nullable RecoilProfile recoil)
    • getRecoilYaw

      public double getRecoilYaw()
    • setRecoilYaw

      public void setRecoilYaw(double recoilYaw)
    • getRecoilPitch

      public double getRecoilPitch()
    • setRecoilPitch

      public void setRecoilPitch(double recoilPitch)
    • isCancelled

      public boolean isCancelled()
      Specified by:
      isCancelled in interface org.bukkit.event.Cancellable
    • setCancelled

      public void setCancelled(boolean cancel)
      Specified by:
      setCancelled in interface org.bukkit.event.Cancellable
    • getHandlers

      @NotNull public org.bukkit.event.HandlerList getHandlers()
      Specified by:
      getHandlers in class org.bukkit.event.Event
    • getHandlerList

      @NotNull public static org.bukkit.event.HandlerList getHandlerList()