How do you make people spawn with adventure mode and without the ability to do commands?
I want to make a Hunger Games map, so I want other players to not be able to break blocks or do commands. I only want to let them open chests and attack the players. How do you do that?
Best Answer
There's no way to disable commands on a per player basis in a map. What you could do is somewhat detect the outcome of a player running a command and undo it. For example, you could have a marker armor stand follow each player to detect teleportation. Or you could undo gamemode changes using \gamemode a @a[m=!2] on a repeating command block.
Don't do that! It's bad practice.
Preventing cheating is not a map-maker's concern. If the map is played online on a public server, cheat-prevention can and should be handled server-side (e.g. by not giving /op to random players). If a player plays with friends and cheats against them, it's a social issue, not your concern. Now the only case left is your player playing alone. The way I see it, if a player wants to cheat your map he will, or he'll quit playing if he finds that he can't.
Now let's look at the other side of the coin. Imagine a regular player playing your map, with no intention to cheat whatsoever, having fun with your great map. An hour into the game, there's an unforseen bug somewhere in the maps commands (realistically, every map will have bugs). No biggie, a quick hop into creative should fix it...
Except this will happen:
[Bob] This door mechanism seems to have broken... All well, that's Minecraft for you.
[Bob] /gamemode c
Bob set own gamemode to creative
[@a] Set Bob's gamemode to adventure
[Bob] What the...?
[Bob] /gamemode c
Bob set own gamemode to creative
[@a] Set Bob's gamemode to adventure
Bob quit the game.
Congratulations, you have now turned a happy player into a frustrated one. And you did it because of players who you didn't like, and whose opinion or happiness you never valued in the first place. This is just about the worst thing you can wish for.
TL;DR: Don't take legitimate tools away from honest players to accommodate the dishonest ones.
Pictures about "How do you make people spawn with adventure mode and without the ability to do commands?"



How do you allow players to place blocks in adventure mode?
Command blocks are intended for use in adventure mode gameplay. A player can switch to Adventure mode from any other game mode by using the commands /gamemode adventure , /gamemode a , or /gamemode 2 .Can you use command blocks in adventure mode?
Adventure mode is a game mode intended for player-created maps, limiting some of the gameplay in Minecraft. In this mode, the player cannot directly destroy any blocks with any tools or place any blocks, in order to avoid spoiling adventure maps or griefing servers.Spawn Protection / Anti-Griefing System | Minecraft Tutorial 1.15 Command
Sources: Stack Exchange - This article follows the attribution requirements of Stack Exchange and is licensed under CC BY-SA 3.0.
Images: Mike, cottonbro, Ivan Samkov, Ivan Samkov
