API reference / @jsprismarine/prismarine / Events / 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(
player,from,to,arrival):PlayerChangeDimensionEvent
Defined in: prismarine/src/events/player/PlayerChangeDimensionEvent.ts:20
Parameters
player
from
to
arrival
Arrival
Returns
PlayerChangeDimensionEvent
Overrides
Methods
getArrival()
getArrival():
Arrival
Defined in: prismarine/src/events/player/PlayerChangeDimensionEvent.ts:45
Where in to the player lands, and facing which way.
Returns
Arrival
getFrom()
getFrom():
World
Defined in: prismarine/src/events/player/PlayerChangeDimensionEvent.ts:35
The world the player is leaving.
Returns
getPlayer()
getPlayer():
Player
Defined in: prismarine/src/events/player/PlayerChangeDimensionEvent.ts:30
Who is traveling.
Returns
getTo()
getTo():
World
Defined in: prismarine/src/events/player/PlayerChangeDimensionEvent.ts:40
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