Gamemode Spectator after death Minecraft 1.16?

Ve
8

I'm currently building a PvP map and have already looked at many commands on good question, but they do not work in 1.16.

Cr
1

Nothing easier than that:

/ execute as @a [scores = {death = 1}, gamemode = survival] run gamemode spectator @a [scores = {death = 1}, gamemode = survival]

you just have to create an objective beforehand that automatically counts the deaths.

/ scoreboard objectives add death deathCount

Ve

Do I have to pack the first one in a command block?

Cr
-1

If you want the command to be executed regularly, so that the players are immediately put into spectator mode when they die, you have to pack the above command into a command block and activate it in repeat mode

Ve

Somehow doesn't work

Cr

You have to create the objective first. And if you want the command to take effect regularly you have to reset the scoreboard with the name death

Ve

Ok, got the scoreboard wrong. Works now.

Gu

It dont works

Gu
2

Syntax has changed a bit for newest versions. Now run /execute as @a[scores={death=1.}, gamemode=survival] run gamemode spectator @s[scores={death=1.}, gamemode=survival] after running / scoreboard objectives add death deathCount