I'm trying to make a trade room where players can't break anything, but still can access chests and press buttons. I have a command block in the spawn area with a pressure plate to teleport the player to the trade room, and another in the trade room to teleport them back to the spawn area.
I tried a chain command block on the tp one that read "gamemode adventure @p", but that didn't work. I then tried a command block in the trade room that read "gamemode adventure @a[distance=..10] to target everyone in the trade room, but that didn't work.
Is there a way to teleport and change gamemode to adventure then back with command blocks?