API reference / @jsprismarine/client / DimensionChange
Class: DimensionChange
Defined in: client/src/DimensionChange.ts:44
The client's half of a dimension change.
A retail client shows a loading screen when ChangeDimension arrives and closes it once it has terrain to stand on, telling the server both edges through ServerboundLoadingScreen. The server holds the change open until it hears EndLoadingScreen with the id it handed out, so a client that never answers is a player stuck between worlds.
This one reports StartLoadingScreen as the change arrives and EndLoadingScreen after the first LevelChunk carrying the new dimension's id, with the client's own PlayerAction ChangeDimensionAck ahead of it as the retail client sends. Waiting for a chunk rather than answering at once keeps the server's chunk-first ordering honest: a server that announced the change and never sent terrain leaves this client on the screen too, which is the failure the retail client shows.
Extends
EventEmitter
Constructors
Constructor
new DimensionChange(
session,logger,runtimeEntityId):DimensionChange
Defined in: client/src/DimensionChange.ts:50
Parameters
session
logger
runtimeEntityId
() => bigint
Returns the runtime id StartGame assigned, for the ack.
Returns
DimensionChange
Overrides
EventEmitter.constructor
Methods
getPending()
getPending():
PendingDimensionChange|null
Defined in: client/src/DimensionChange.ts:60
The change in progress, or null when this client is settled in a dimension.
Returns
PendingDimensionChange | null