Skip to content

API reference / @jsprismarine/prismarine / world/portal/DimensionTravel

world/portal/DimensionTravel ​

Classes ​

Interfaces ​

MoveTarget ​

Defined in: packages/prismarine/src/world/portal/DimensionTravel.ts:160

Where a player's move goes, which may need its world built or its spawn found before the input step can carry the move out.

Methods ​

prepare() ​

prepare(): Promise<void>

Defined in: packages/prismarine/src/world/portal/DimensionTravel.ts:172

Starts what MoveTarget.ready waits for, outside every tick, and settles once ready can answer.

A move whose preparation settles, fulfilled or rejected, while ready still answers undefined is dropped at the next input step. Left filed, it would be prepared again at every step and hold the player's later moves behind it for good. A target whose work goes on after prepare settles therefore loses its move: wait for the work here.

Returns ​

Promise<void>

ready() ​

ready(): Arrival | undefined

Defined in: packages/prismarine/src/world/portal/DimensionTravel.ts:162

The arrival once the move can land without waiting, or undefined while it cannot.

Returns ​

Arrival | undefined


PortalArrival ​

Defined in: packages/prismarine/src/world/portal/DimensionTravel.ts:60

Where a portal trip lands, which is an Arrival plus what the trip built.

Extends ​

Properties ​

closesLoadingScreen? ​

optional closesLoadingScreen?: boolean

Defined in: packages/prismarine/src/player/PlayerSession.ts:168

Whether the client closes a loading screen for this change, which the change then stays pending on. Defaults to true; a respawn after a death is the one the client does not.

Inherited from ​

Arrival.closesLoadingScreen

createdPortal ​

readonly createdPortal: boolean

Defined in: packages/prismarine/src/world/portal/DimensionTravel.ts:62

True when the trip wrote a new nether portal to arrive in.

pitch ​

pitch: number

Defined in: packages/prismarine/src/player/PlayerSession.ts:161

Inherited from ​

Arrival.pitch

position ​

position: Vector3

Defined in: packages/prismarine/src/player/PlayerSession.ts:159

Feet position in world, never the eyes.

Inherited from ​

Arrival.position

respawn? ​

optional respawn?: boolean

Defined in: packages/prismarine/src/player/PlayerSession.ts:163

Whether the change follows a death rather than a portal or a teleport. Defaults to false.

Inherited from ​

Arrival.respawn

world ​

world: World

Defined in: packages/prismarine/src/player/PlayerSession.ts:157

The world the player arrives in.

Inherited from ​

Arrival.world

yaw ​

yaw: number

Defined in: packages/prismarine/src/player/PlayerSession.ts:160

Inherited from ​

Arrival.yaw


PortalBlockRef ​

Defined in: packages/prismarine/src/world/portal/DimensionTravel.ts:50

The portal block an entity is standing in.

Properties ​

block ​

readonly block: string

Defined in: packages/prismarine/src/world/portal/DimensionTravel.ts:56

The portal block's identifier, such as minecraft:portal.

position ​

readonly position: Vector3

Defined in: packages/prismarine/src/world/portal/DimensionTravel.ts:54

The portal block's position.

world ​

readonly world: World

Defined in: packages/prismarine/src/world/portal/DimensionTravel.ts:52

The world the portal block is in.

Variables ​

END_ARRIVAL_YAW ​

const END_ARRIVAL_YAW: 90 = 90

Defined in: packages/prismarine/src/world/portal/DimensionTravel.ts:79

Java's Direction.WEST.toYRot(): the yaw a traveler faces on arriving in the End. Bedrock counts yaw the same way, 0 south and 90 west.

Java Source ​

Direction.toYRot


END_SPAWN_POINT ​

const END_SPAWN_POINT: object

Defined in: packages/prismarine/src/world/portal/DimensionTravel.ts:71

Java's ServerLevel.END_SPAWN_POINT, new BlockPos(100, 50, 0): where an end portal drops everything that goes into the End.

Type Declaration ​

x ​

readonly x: 100 = 100

y ​

readonly y: 50 = 50

z ​

readonly z: 0 = 0

Java Source ​

ServerLevel.END_SPAWN_POINT

Functions ​

arrivalTarget() ​

arrivalTarget(arrival): MoveTarget

Defined in: packages/prismarine/src/world/portal/DimensionTravel.ts:176

A move to a world that is already built, with nothing to prepare.

Parameters ​

arrival ​

Arrival

Returns ​

MoveTarget


isMidDimensionChange() ​

isMidDimensionChange(entity): boolean

Defined in: packages/prismarine/src/world/portal/DimensionTravel.ts:277

Whether an entity is a player whose client has not yet closed the loading screen of its last world change.

Such a player is still ticked, standing in the arrival portal, and must not start another trip: PlayerSession.changeWorld would refuse it, after the contact had already run.

Parameters ​

entity ​

StoreActor

Returns ​

boolean


spawnTarget() ​

spawnTarget(world, facing): MoveTarget

Defined in: packages/prismarine/src/world/portal/DimensionTravel.ts:200

A move to a world's spawn, where a joining player's feet go before the terrain is consulted (requestedSpawnPosition). A world that has not found its spawn searches for it outside every tick.

Parameters ​

world ​

World

facing ​

Pick<Arrival, "yaw" | "pitch">

Returns ​

MoveTarget


stemTarget() ​

stemTarget(level, stemId, place): MoveTarget

Defined in: packages/prismarine/src/world/portal/DimensionTravel.ts:187

A move into a level's world of one stem, which is built outside every tick when nobody has entered it yet.

Parameters ​

level ​

Level

stemId ​

string

place ​

Omit<Arrival, "world">

The feet position and facing in the world, once it is built.

Returns ​

MoveTarget