Class PlayerTeleportOutOfArenaEvent
java.lang.Object
org.bukkit.event.Event
org.bukkit.event.player.PlayerEvent
de.marcely.bedwars.api.event.player.PlayerTeleportOutOfArenaEvent
- All Implemented Interfaces:
ArenaEvent
,Cancellable
Gets called when a player teleports himself out of the arena during a game.
Canceling the event will prevent the player from getting kicked, but will still let him teleport the new location
if granted by the PlayerTeleportEvent
.
-
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
ConstructorDescriptionPlayerTeleportOutOfArenaEvent
(Player player, Arena arena, Location from, Location to, PlayerTeleportEvent.TeleportCause cause) -
Method Summary
Modifier and TypeMethodDescriptiongetCause()
Returns what caused him to teleport.getFrom()
Returns the current location of the player.static HandlerList
getTo()
Returns the location to which the player is trying to teleport to.boolean
void
setCancelled
(boolean bool) void
Set the new location to which the player shall get teleported to.Methods inherited from class org.bukkit.event.player.PlayerEvent
getPlayer
Methods inherited from class org.bukkit.event.Event
getEventName, isAsynchronous
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface de.marcely.bedwars.api.event.arena.ArenaEvent
getArena
-
Constructor Details
-
PlayerTeleportOutOfArenaEvent
public PlayerTeleportOutOfArenaEvent(Player player, Arena arena, Location from, Location to, PlayerTeleportEvent.TeleportCause cause)
-
-
Method Details
-
getFrom
Returns the current location of the player.- Returns:
- His location before this event fired
-
getTo
Returns the location to which the player is trying to teleport to.- Returns:
- His new location
-
setTo
Set the new location to which the player shall get teleported to.- Parameters:
to
- His new location
-
getCause
Returns what caused him to teleport.- Returns:
- The teleport cause
-
setCancelled
public void setCancelled(boolean bool) - Specified by:
setCancelled
in interfaceCancellable
-
isCancelled
public boolean isCancelled()- Specified by:
isCancelled
in interfaceCancellable
-
getHandlers
- Specified by:
getHandlers
in classEvent
-
getHandlerList
-