Class AsyncPlayerTeleportEvent
java.lang.Object
org.bukkit.event.Event
org.bukkit.event.player.PlayerEvent
io.prismmc.prism.event.player.AsyncPlayerTeleportEvent
- All Implemented Interfaces:
Cancellable
Called before a player is teleported through
Entity.teleportAsync(Location): by a plugin, a
command, or the server. Folia never calls PlayerTeleportEvent for these teleports; this event stands for it.
The destination may be changed, or the teleport cancelled.
"Async" names the teleport, not the thread: the event is called on the thread that owns the player, where the
player may be read and changed. A teleport to another world is followed, once the player is there, by
AsyncPlayerWorldChangeEvent.
-
Nested Class Summary
Nested classes/interfaces inherited from class Event
Event.Result -
Field Summary
Fields inherited from class PlayerEvent
player -
Constructor Summary
ConstructorsConstructorDescriptionAsyncPlayerTeleportEvent(Player player, Location from, Location to, PlayerTeleportEvent.TeleportCause cause) -
Method Summary
Modifier and TypeMethodDescriptionbooleanWhether the player changes world with this teleport, as it stands.getCause()Why the player is teleported.getFrom()Where the player is before the teleport.static HandlerListgetTo()Where the player is about to be teleported.booleanvoidsetCancelled(boolean cancel) Cancels the teleport: the player stays where they are.voidSends the player somewhere else, in this world or another one.Methods inherited from class PlayerEvent
getPlayerMethods inherited from class Event
callEvent, getEventName, isAsynchronous
-
Constructor Details
-
AsyncPlayerTeleportEvent
@Internal public AsyncPlayerTeleportEvent(Player player, Location from, Location to, PlayerTeleportEvent.TeleportCause cause)
-
-
Method Details
-
getFrom
Where the player is before the teleport. -
getTo
Where the player is about to be teleported. -
setTo
Sends the player somewhere else, in this world or another one. -
getCause
Why the player is teleported. -
changesWorld
public boolean changesWorld()Whether the player changes world with this teleport, as it stands. -
isCancelled
public boolean isCancelled()- Specified by:
isCancelledin interfaceCancellable
-
setCancelled
public void setCancelled(boolean cancel) Cancels the teleport: the player stays where they are.- Specified by:
setCancelledin interfaceCancellable
-
getHandlers
- Specified by:
getHandlersin classEvent
-
getHandlerList
-