PlayerTeleportEvent
Documentation for the PlayerTeleportEvent event in the Irminsul game server API
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
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.
An invalid scene ID can crash the client! Be careful.
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.)
Last updated