This guide will allow you to implement bed-breaking into your bedwars maps. How, you ask? Well here:
Concept
When you die, you teleport to a room. If your bed is not broken, then you will be teleported back to your base. However, if you don’t have a bed, then you will not be teleported back.
Implementation
First, make a small lobby-like room. This should have a spawn pad for ALL PLAYERS, not just for a specific team. Next, put a lifecycle down. Make it listen for a player knockED out. Make it broadcast on “Player Knocked Out”. Now make a property that stores whether or not the player is knocked out. Make a trigger that is triggered when receiving on “Player Knocked Out”. After this, go into the blocks for the trigger and use the “if” block to check if the bed is broken.
Note: If you use a team-scope property, ignore the next part
Use concatenation to call the property:
Put whatever value the bed being not broken is. If the bed being broken is true, then check if it is false, for example. After that, make it broadcast on a channel, using concatenation, to take them to their base.
That is for if the bed is not broken. If it is broken, broadcast on “brokenBed”. Make a teamswitcher switch the player to spectator when receiving on “brokenBed”.