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
readonlyannounced:RespawnPosition
Defined in: packages/prismarine/src/world/RespawnSearch.ts:53
The three positions the respawn exchange sends; see respawnPoint.
block
readonlyblock:RespawnPosition
Defined in: packages/prismarine/src/world/RespawnSearch.ts:54
dimension
readonlydimension: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
readonlyeyes:RespawnPosition
Defined in: packages/prismarine/src/world/RespawnSearch.ts:55
player
readonlyplayer:string
Defined in: packages/prismarine/src/world/RespawnSearch.ts:44
The key the request named.
spawn
readonlyspawn:"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
readonlyspawnPoint: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
readonlyspawnPointLost: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
readonlyx:number
Defined in: packages/prismarine/src/world/RespawnSearch.ts:26
y
readonlyy:number
Defined in: packages/prismarine/src/world/RespawnSearch.ts:27
z
readonlyz: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
readonlybody: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
readonlyeyeHeight:number
player
readonlyplayer:string
Defined in: packages/prismarine/src/world/RespawnSearch.ts:34
The player's key; see keyOfPlayer. The answer carries it back.
spawnPoint
readonlyspawnPoint: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
Type Aliases
RespawnAttempt
RespawnAttempt = {
answer:RespawnAnswer;kind:"answer"; } | {failed?: readonlyunknown[];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.