Minecraft vanilla bedwars spawn system?

La
3

I want to build a vanilla spawnsystem that it runs like bedwars, that is

a player spawns at his bed when it's off he spawns in the lobby. Question is,

I have already written in a Command Block that he should set the Spawnpunkt. However, if I sleep in bed and mine it, I will not spawn in the lobby, though I've built a Redstone clock on the Commaand block. Conversely, if I do not sleep in bed and still die, I will spawn in the lobby. Can someone help me there?

cl

Setworldspawn?

La

Nah, if I break my bed then there's bed missing and I trap into void

cl

You are doing something tremendously wrong.

Put the worldspawn with / setworldspawn on a block / in the lobby.