Skip to content

API reference / @jsprismarine/prismarine / world/RespawnSearch

world/RespawnSearch ​

Classes ​

Interfaces ​

RespawnAnswer ​

Defined in: packages/prismarine/src/world/RespawnSearch.ts:42

Where the search says the player comes back.

Properties ​

announced ​

readonly announced: RespawnPosition

Defined in: packages/prismarine/src/world/RespawnSearch.ts:53

The three positions the respawn exchange sends; see respawnPoint.

block ​

readonly block: RespawnPosition

Defined in: packages/prismarine/src/world/RespawnSearch.ts:54

dimension ​

readonly dimension: string

Defined in: packages/prismarine/src/world/RespawnSearch.ts:51

The id of the dimension the position is in, such as minecraft:the_nether.

eyes ​

readonly eyes: RespawnPosition

Defined in: packages/prismarine/src/world/RespawnSearch.ts:55

player ​

readonly player: string

Defined in: packages/prismarine/src/world/RespawnSearch.ts:44

The key the request named.

spawn ​

readonly spawn: "world" | "own"

Defined in: packages/prismarine/src/world/RespawnSearch.ts:49

Which spawn it is: own is the player's spawn point, in its dimension of the level the search belongs to, and world is the world spawn, in the default level's Overworld.

spawnPoint ​

readonly spawnPoint: StoredSpawnPoint | undefined

Defined in: packages/prismarine/src/world/RespawnSearch.ts:66

The spawn point the search examined, the request's. A player who set another one while the search waited keeps it.

spawnPointLost ​

readonly spawnPointLost: boolean

Defined in: packages/prismarine/src/world/RespawnSearch.ts:61

Whether the player's own spawn point stopped holding: the bed or anchor is gone or has nowhere free beside it, or names a dimension the level has no stem for. The player clears it and is told, so the next death goes straight to the world spawn.


RespawnPosition ​

Defined in: packages/prismarine/src/world/RespawnSearch.ts:25

A position as plain numbers.

Properties ​

x ​

readonly x: number

Defined in: packages/prismarine/src/world/RespawnSearch.ts:26

y ​

readonly y: number

Defined in: packages/prismarine/src/world/RespawnSearch.ts:27

z ​

readonly z: number

Defined in: packages/prismarine/src/world/RespawnSearch.ts:28


RespawnRequest ​

Defined in: packages/prismarine/src/world/RespawnSearch.ts:32

What a respawn search is asked.

Properties ​

body ​

readonly body: BodyBox & object

Defined in: packages/prismarine/src/world/RespawnSearch.ts:38

The player's body: the box that has to fit at the world spawn, and the eye height above the feet.

Type Declaration ​
eyeHeight ​

readonly eyeHeight: number

player ​

readonly player: string

Defined in: packages/prismarine/src/world/RespawnSearch.ts:34

The player's key; see keyOfPlayer. The answer carries it back.

spawnPoint ​

readonly spawnPoint: StoredSpawnPoint | undefined

Defined in: packages/prismarine/src/world/RespawnSearch.ts:36

The player's own spawn point, from a bed, an anchor or /spawnpoint, or undefined for none.


RespawnWorlds ​

Defined in: packages/prismarine/src/world/RespawnSearch.ts:70

The worlds a search reads.

Methods ​

built() ​

built(stemId): World | undefined

Defined in: packages/prismarine/src/world/RespawnSearch.ts:76

The level's world of a stem if it is built and enabled, without building it.

Parameters ​
stemId ​

string

Returns ​

World | undefined

hasStem() ​

hasStem(stemId): boolean

Defined in: packages/prismarine/src/world/RespawnSearch.ts:72

Whether the level the search belongs to has a stem of that id.

Parameters ​
stemId ​

string

Returns ​

boolean

world() ​

world(stemId): Promise<World>

Defined in: packages/prismarine/src/world/RespawnSearch.ts:74

The level's world of a stem, built and enabled when nobody has been there since the save opened.

Parameters ​
stemId ​

string

Returns ​

Promise<World>

worldSpawn() ​

worldSpawn(): World

Defined in: packages/prismarine/src/world/RespawnSearch.ts:78

The world the world spawn is in: the default level's Overworld.

Returns ​

World

Type Aliases ​

RespawnAttempt ​

RespawnAttempt = { answer: RespawnAnswer; kind: "answer"; } | { failed?: readonly unknown[]; kind: "waiting"; }

Defined in: packages/prismarine/src/world/RespawnSearch.ts:136

What an attempt says: the answer, or that it waits for something it has asked for. A waiting attempt carries what went wrong with work an earlier attempt started for it, which this one started again, for the caller to report.