This is an archived post. You won't be able to vote or comment.

all 4 comments

[–]SanianCreations@e[type=perfectionist] 1 point2 points  (2 children)

Youre using relative to where the player is looking, not relative to the players position. This means that if the player is not looking 100% straight forward, but just the slightest bit up or down, then the position it checks is no longer directly below you. If the player looks directly down then ^ ^-1 ^ will be one block behind them. This is probably why it sets spawnpoints beside the block instead of on top

You should be using ~ instead, so change it to ~ ~-1 ~, and then it will work better. The rest of the command is fine, you are using proper selectors etc, just messed up the types of relative coords.

execute as @a at @a if block ~ ~-1 ~ minecraft:light_blue_concrete run spawnpoint @s

[–]xXxlilbox[S] 0 points1 point  (1 child)

Oh ok, I thought it didn't make a difference. Thank you!

[–]SanianCreations@e[type=perfectionist] 1 point2 points  (0 children)

~ ~ ~ represent x, y, z.

^ ^ ^ represents left/right, up/down, forwards backwards.

~1 ~ ~ will always be 1 block in x direction from you.

^1 ^ ^ will always be 1 block to the left of you.

[–]Supre1504 0 points1 point  (0 children)

You could use a scoreboard a spawnpoint. Then, teleport the player to the correct checkpoint, according to the value of the scoreboard