# PlayerTeleportEvent

PlayerTeleportEvent is a **cancellabe** event fired when a player teleports from one location to another for any reason

## Fields

### cancelled

*boolean, inherited*

Whether this event has been cancelled

### player

final *`io.irminsul.common.game.player.Player`*

The player teleporting. Guaranteed non-null.

### fromScene

final int

The ID of the scene the player is teleporting from. May be zero (none) if the player is first logging in.

### toScene

int

&#x20;The ID of the scene the player is teleporting to. Must not be zero.

If `toScene` has a value of zero, the teleport will not be processed, and a warning will be generated in the server console.

{% hint style="warning" %}
An invalid scene ID can crash the client! Be careful.
{% endhint %}

### fromPos

final *`io.irminsul.common.game.world.Position`*

The position the player is teleporting from. May be null if the player is first logging in.

### toPos

*`io.irminsul.common.game.world.Position`*

The position the player is teleporting to. Must not be null.

This position should not be the same as `fromPos`. If your intention is to cancel the event, the proper way to do this is via `setCancelled(true)`.

### reason

int

The reason for the teleport. Some common values include:

* LOGIN: 1
* DUNGEON\_ENTER: 13
* DUNGEON\_QUIT: 14
* TRANS\_POINT: 42 (Teleport Waypoint, Statue of the Seven, Domain, Abyss island, etc.)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://irminsul.gitbook.io/irminsul/api/api-references/game-events/playerteleportevent.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
