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
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.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.bukkit.event.Event
Event.Result -
Field Summary
Fields inherited from class org.bukkit.event.player.PlayerEvent
player -
Constructor Summary
ConstructorsConstructorDescriptionPlayerUseSpecialItemFireballEvent(PlayerUseSpecialItemEvent origin, ProjectileSource shooter, Location spawnLocation, Vector direction, float yield, double flightSpeed, boolean flyStraight, @Nullable Integer autoIgnitionTicks) -
Method Summary
Modifier and TypeMethodDescriptiongetArena()Returns theArenathat is involved in this event.@Nullable IntegerSet the amount of ticks after which the fireball shall ignite itself.Returns the direction in which the fireball shall fly.doubleReturns the speed of the fireball.static HandlerListReturns the event that was called right before this event.Returns the entity from whom the fireball shall come from.Returns the location where the fireball shall spawn.floatgetYield()Returns the yield of the explosion.booleanReturns whether the fireball shall fly straight.voidsetAutoIgnitionTicks(@Nullable Integer autoIgnitionTicks) Set the amount of ticks after which the fireball shall ignite itself.voidsetDirection(Vector direction) Sets the direction in which the fireball shall fly.voidsetFlightSpeed(double flightSpeed) Sets the speed of the fireball.voidsetShooter(ProjectileSource shooter) Sets the entity from whom the fireball shall come from.voidsetSpawnLocation(Location spawnLocation) Sets the location where the fireball shall spawn.voidsetYield(float yield) Sets the yield of the explosion.Methods inherited from class org.bukkit.event.player.PlayerEvent
getPlayerMethods inherited from class org.bukkit.event.Event
getEventName, isAsynchronous
-
Constructor Details
-
PlayerUseSpecialItemFireballEvent
public PlayerUseSpecialItemFireballEvent(PlayerUseSpecialItemEvent origin, ProjectileSource shooter, Location spawnLocation, Vector direction, float yield, double flightSpeed, boolean flyStraight, @Nullable @Nullable Integer autoIgnitionTicks)
-
-
Method Details
-
getArena
Description copied from interface:ArenaEventReturns theArenathat is involved in this event.- Specified by:
getArenain interfaceArenaEvent- Returns:
- The arena that is involved
-
getOriginEvent
Returns the event that was called right before this event.- Returns:
- The origin event
-
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
Sets the entity from whom the fireball shall come from.- Parameters:
shooter- The new entity from whom the fireball shall come from
-
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
Sets the location where the fireball shall spawn.- Parameters:
spawnLocation- The new location where the fireball shall spawn
-
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
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.- Returns:
- The yield of the explosion
-
setYield
public void setYield(float yield) Sets the yield of the explosion.- 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
-
getAutoIgnitionTicks
Set the amount of ticks after which the fireball shall ignite itself.- Returns:
- The amount of ticks until it ignites.
nullif it shouldn't ignite itself
-
setAutoIgnitionTicks
Set the amount of ticks after which the fireball shall ignite itself.- Parameters:
autoIgnitionTicks- The amount of ticks until it ignites.nullif it shouldn't ignite itself
-
getHandlers
- Specified by:
getHandlersin classEvent
-
getHandlerList
-