How do you teleport a certain player to spawn after they win a 1v1
Solution 1:
Check for the other person not being there. You can do this by tagging an arbitrary player inside the room (would be the only one if he/she won), then checking if there's another untagged one and then removing the tag again:
/tag @p[x=…,y=…,z=…,dx=…,dy=…,dz=…] add inRoom
/execute unless @p[x=…,y=…,z=…,dx=…,dy=…,dz=…,tag=!inRoom] as @p[tag=inRoom] run <command>
/tag @a remove inRoom
Replace "…
" with the lowest coordinates and the size of the room and "<command>
" with whatever you want to do with the winning player (for example teleportation). If you want to do it relative to that player's location, add "at @s
" before "run
".