Package org.bukkit.event.player

# Class PlayerTeleportEvent

java.lang.Object
org.bukkit.event.Event
org.bukkit.event.player.PlayerEvent
org.bukkit.event.player.PlayerMoveEvent
org.bukkit.event.player.PlayerTeleportEvent

All Implemented Interfaces:
  `Cancellable`

Direct Known Subclasses:
  `PlayerPortalEvent`, `PlayerTeleportEndGatewayEvent`

public class PlayerTeleportEvent extends PlayerMoveEvent
Holds information for player teleport events

## Nested Class Summary

Nested Classes
Modifier and Type
Class
Description
`static enum`
`PlayerTeleportEvent.TeleportCause`

## 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

Constructors
Constructor
Description
`PlayerTeleportEvent(@NotNull Player player, @NotNull Location from, @Nullable Location to)`
`PlayerTeleportEvent(@NotNull Player player, @NotNull Location from, @Nullable Location to, @NotNull PlayerTeleportEvent.TeleportCause cause)`
`PlayerTeleportEvent(@NotNull Player player, @NotNull Location from, @Nullable Location to, @NotNull PlayerTeleportEvent.TeleportCause cause, boolean dismounted, Set<@NotNull RelativeTeleportFlag> teleportFlagSet)`

## Method Summary

Modifier and Type
Method
Description
`@NotNull PlayerTeleportEvent.TeleportCause`
`getCause()`
Gets the cause of this teleportation event
`static @NotNull HandlerList`
`getHandlerList()`
`@NotNull HandlerList`
`getHandlers()`
`Set<@NotNull RelativeTeleportFlag>`
`getRelativeTeleportationFlags()`
Returns the relative teleportation flags used in this teleportation.
`boolean`
`willDismountPlayer()`
Gets if the player will be dismounted in this teleportation.

### Methods inherited from class org.bukkit.event.player.PlayerMoveEvent

`getFrom, getTo, hasChangedBlock, hasChangedOrientation, hasChangedPosition, hasExplicitlyChangedBlock, hasExplicitlyChangedPosition, isCancelled, setCancelled, setFrom, setTo`

### Methods inherited from class org.bukkit.event.player.PlayerEvent

`getPlayer`

### Methods inherited from class org.bukkit.event.Event

`callEvent, getEventName, isAsynchronous`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### PlayerTeleportEvent

public PlayerTeleportEvent(@NotNull @NotNull Player player, @NotNull @NotNull Location from, @Nullable @Nullable Location to)

### PlayerTeleportEvent

public PlayerTeleportEvent(@NotNull @NotNull Player player, @NotNull @NotNull Location from, @Nullable @Nullable Location to, @NotNull @NotNull PlayerTeleportEvent.TeleportCause cause)

### PlayerTeleportEvent

@Experimental public PlayerTeleportEvent(@NotNull @NotNull Player player, @NotNull @NotNull Location from, @Nullable @Nullable Location to, @NotNull @NotNull PlayerTeleportEvent.TeleportCause cause, boolean dismounted, @NotNull Set<@NotNull RelativeTeleportFlag> teleportFlagSet)

## Method Details

### getCause

@NotNull public @NotNull PlayerTeleportEvent.TeleportCause getCause()
Gets the cause of this teleportation event

Returns:
  Cause of the event

### willDismountPlayer

@Experimental public boolean willDismountPlayer()
Gets if the player will be dismounted in this teleportation.

Returns:
  dismounted or not

### getRelativeTeleportationFlags

@Experimental @NotNull public Set<@NotNull RelativeTeleportFlag> getRelativeTeleportationFlags()
Returns the relative teleportation flags used in this teleportation. This determines which axis the player will not lose their velocity in.

Returns:
  an immutable set of relative teleportation flags

### getHandlers

@NotNull public @NotNull HandlerList getHandlers()

Overrides:
  `getHandlers` in class `PlayerMoveEvent`

### getHandlerList

@NotNull public static @NotNull HandlerList getHandlerList()