Minecraft chests / switches / workbenches etc. Use in game mode 3?

Ma
- in Mods
2

I'm currently building a Among Us Map in Minecraft (first 1.17 snapshot) without mods or data packs. Now I have a problem: if a player dies, they should be able to fly through blocks. Gamemode 3 does not work in itself, because you still have to be able to do tasks. Is there any command creation or something like that? Please do not suggest any mods or plugins, as I want to recreate Among Us in Minecraft Vanilla.

Po

Then the player only has to be set to game mode 1 and receive an invisibility effect as soon as he is close to the task.

Ma

Oh right! Why didn't I figure it out myself?!