Bed (Expression) — Skript

Addon: Skript · Category: Expression · Since: 2.0, 2.7 (offlineplayers, safe bed)

Syntax

[the] [((safe|valid)|(unsafe|invalid))] bed[s] [location[s]] of %offlineplayers%

Description

Returns the bed location of a player, i.e. the spawn point of a player if they ever slept in a bed and the bed still exists and is unobstructed however, you can set the unsafe bed location of players and they will respawn there even if it has been obstructed or doesn't exist anymore and that's the default behavior of this expression otherwise you will need to be specific i.e. <code>safe bed location</code>.

NOTE: Offline players can not have their bed location changed, only online players.

Examples

if bed of player exists:
	teleport player the the player's bed
else:
	teleport the player to the world's spawn point
set the bed location of player to spawn location of world("world") # unsafe/invalid bed location
set the safe bed location of player to spawn location of world("world") # safe/valid bed location

View source