Class PlayerUseSpecialItemFireballEvent

java.lang.Object
org.bukkit.event.Event
org.bukkit.event.player.PlayerEvent
de.marcely.bedwars.api.event.player.PlayerUseSpecialItemFireballEvent
All Implemented Interfaces:
ArenaEvent

public class PlayerUseSpecialItemFireballEvent extends PlayerEvent implements ArenaEvent
Gets called when a player is about to use the SpecialItemType.FIREBALL special item.

It is not possible to cancel this event. Listen to PlayerUseSpecialItemEvent instead.

  • Constructor Details

  • Method Details

    • getArena

      public Arena getArena()
      Description copied from interface: ArenaEvent
      Returns the Arena that is involved in this event.
      Specified by:
      getArena in interface ArenaEvent
      Returns:
      The arena that is involved
    • getOriginEvent

      public PlayerUseSpecialItemEvent getOriginEvent()
      Returns the event that was called right before this event.
      Returns:
      The origin event
    • getShooter

      public ProjectileSource getShooter()
      Returns the entity from whom the fireball shall come from.

      By default it's equal to the player who has used the special item.

      Returns:
      The entity from whom the fireball shall come from
    • setShooter

      public void setShooter(ProjectileSource shooter)
      Sets the entity from whom the fireball shall come from.
      Parameters:
      shooter - The new entity from whom the fireball shall come from
    • getSpawnLocation

      public Location getSpawnLocation()
      Returns the location where the fireball shall spawn.

      By default it's nearby the player's eye location.

      Returns:
      The location where the fireball shall spawn
    • setSpawnLocation

      public void setSpawnLocation(Location spawnLocation)
      Sets the location where the fireball shall spawn.
      Parameters:
      spawnLocation - The new location where the fireball shall spawn
    • getDirection

      public Vector getDirection()
      Returns the direction in which the fireball shall fly.

      By default it's equal to the player's looking direction.

      Returns:
      The direction in which the fireball shall fly
    • setDirection

      public void setDirection(Vector direction)
      Sets the direction in which the fireball shall fly.
      Parameters:
      direction - The new direction in which the fireball shall fly
    • getYield

      public float getYield()
      Returns the yield of the explosion.

      Uses Explosive.setYield(float).

      Returns:
      The yield of the explosion
    • setYield

      public void setYield(float yield)
      Sets the yield of the explosion.

      Uses Explosive.setYield(float).

      Parameters:
      yield - The new yield of the explosion
    • getFlightSpeed

      public double getFlightSpeed()
      Returns the speed of the fireball.
      Returns:
      The speed of the fireball
    • setFlightSpeed

      public void setFlightSpeed(double flightSpeed)
      Sets the speed of the fireball.
      Parameters:
      flightSpeed - The new speed of the fireball
    • isFlyingStraight

      public boolean isFlyingStraight()
      Returns whether the fireball shall fly straight.

      Vanilla adds a small random deviation to the fireball's trajectory.

      Returns:
      If the fireball shall fly straight
    • setFlyStraight

      public void setFlyStraight(boolean flyStraight)
      Sets whether the fireball shall fly straight.

      Vanilla adds a small random deviation to the fireball's trajectory.

      Parameters:
      flyStraight - If the fireball shall fly straight
    • getHandlers

      public HandlerList getHandlers()
      Specified by:
      getHandlers in class Event
    • getHandlerList

      public static HandlerList getHandlerList()