How to detect player deaths in 1.16 and detect who died [closed]
You can do this by creating a scoreboard objective that tracks deaths, and then setting anyone with a score of at least 1 (0 being that you haven't died yet) to spectator mode.
/gamemode spectator @a[scores={deaths=1..}]
(Assuming death
is your deaths scoreboard objective)
You can then set the value of that score to 0 once a round ends to remove said force-spectatoring.
/scoreboard players set @a[scores={deaths=1..}] deaths 0
/gamemode adventure @a[scores={deaths=0}]