API reference / @jsprismarine/prismarine / events/player/PlayerChangeDimensionEvent / PlayerChangeDimensionEvent
Class: PlayerChangeDimensionEvent
Defined in: prismarine/src/events/player/PlayerChangeDimensionEvent.ts:14
Fired just before a player leaves one world for another through a portal, with the destination resolved.
Cancelable. A canceled event leaves the player in the world they stand in, with no cooldown set and nothing sent to the client. The arrival is the resolved landing place, so a listener can read where the trip would end before deciding.
Extends
Constructors
Constructor
new PlayerChangeDimensionEvent(
session,from,to,arrival):PlayerChangeDimensionEvent
Defined in: prismarine/src/events/player/PlayerChangeDimensionEvent.ts:19
Parameters
session
from
to
arrival
Returns
PlayerChangeDimensionEvent
Overrides
Methods
getArrival()
getArrival():
Arrival
Defined in: prismarine/src/events/player/PlayerChangeDimensionEvent.ts:37
Where in to the player lands, and facing which way.
Returns
getFrom()
getFrom():
World
Defined in: prismarine/src/events/player/PlayerChangeDimensionEvent.ts:27
The world the player is leaving.
Returns
getIdentity()
getIdentity():
PlayerIdentity
Defined in: prismarine/src/events/player/PlayerEvent.ts:34
Who the player logged in as.
Returns
PlayerIdentity
The name, the XUID (empty when the login carried none) and the UUID.
Inherited from
getRuntimeId()
getRuntimeId():
bigint
Defined in: prismarine/src/events/player/PlayerEvent.ts:26
The player's runtime id, which the wire and the player's session use.
Returns
bigint
The id.
Inherited from
getSession()
getSession():
PlayerSession
Defined in: prismarine/src/events/player/PlayerEvent.ts:44
The session of the player the event is about, for a listener that acts on the player: it sends to the client, and getPlayer() reaches the player's state while it is connected. To name the player, read PlayerEvent.getRuntimeId or PlayerEvent.getIdentity.
Returns
The session.
Inherited from
getTo()
getTo():
World
Defined in: prismarine/src/events/player/PlayerChangeDimensionEvent.ts:32
The world the player arrives in.
Returns
isCanceled()
isCanceled():
boolean
Defined in: prismarine/src/events/Event.ts:12
Is the event canceled
Returns
boolean
Whether the event is canceled
Inherited from
preventDefault()
preventDefault():
void
Defined in: prismarine/src/events/Event.ts:19
Cancel the event
Returns
void