Take the 2-minute tour ×
Arqade is a question and answer site for passionate videogamers on all platforms. It's 100% free, no registration required.

I need everyone playing the map to be automatically set to adventure mode. How? What is the command?

share|improve this question
2  
From the previous question you posted in, apparently /gamemode 2 should do it. Have you tried that? –  Frank Oct 29 '12 at 17:04
1  
Is this on a dedicated server? Or on a LAN type game? On a dedicated server you can use gamemode=2 in the server.properties file and that will affect all future players as well. –  Kurley Oct 30 '12 at 8:43
1  
Or /defaultgamemode 2 should work –  jrtc27 Oct 31 '12 at 18:35

4 Answers 4

You can enter the command:

/gamemode 2 @[m=0,r=X]

Set X to the radius you want to have people in the adventure mode.

You can also make a second block with the command:

/ gamemode 0 @a[m=2,rm=x+1]

X+1 will switch the players back into the gamemode survival. This would all be connected to a clock or repeating pulser to always check for players. This is a great world guard for servers and adventure maps.

share|improve this answer

Well you can always set the command /gamemode 2 @a and then run a clock that activates the command block ever few seconds. Then players dont need to click a button.

share|improve this answer
2  
That would lag pretty bad... –  Timtech Jul 31 '13 at 22:15

Or you could have them spawn on a pressure plate which sets them to adventure mode, and then once they leave the spawn (with a command block teleporter), it will set them to survival mode. This isn't really used for an adventure server, but it's a good way to make the spawn grief-proof without having to make it out of bedrock.

share|improve this answer
    
I'm not sure if this was the case before I started playing, but currently the spawn is protected by default in SMP. You have to configure the server to disable this or make someone an op to allow them to break blocks. –  Coronus Jul 31 '13 at 20:34

Unfortunately, there is no real command to set everyone to a gamemode. You would have to have a command block with the command:

/gamemode 2

And then have all the players hit a button or something to activate the block when they spawn. You could, perhaps, have a spawn room with an iron door, and hook the button to open the door up to a command block.

EDIT: Apparently you can also use

/gamemode 2 @a

To set all players to gamemode 2 (adventure mode).

share|improve this answer
12  
If you use gamemode 2 @a it will run the command for all players. –  Ronan Forman Oct 29 '12 at 17:25

protected by Community Nov 26 '13 at 19:57

Thank you for your interest in this question. Because it has attracted low-quality answers, posting an answer now requires 10 reputation on this site.

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged or ask your own question.