0

This question already has an answer here:

I want to execute a command in which within a certain radius, players will always be in adventure mode, once outside of that radius, they will be in survival. The command I am trying to use is /gamemode a @a [rm=100] Gamemode S but it's not working quite right.

How do I do this? I do not have much experience with command blocks, all help is appreciated!

Edit: The link provided does not work with a command block, anything else?

I should have noted earlier that I am attempting this on console, sorry for not establishing that earlier!

marked as duplicate by Fabian Röling, Gigazelle, Virusbomb, Unionhawk, arghtype Jan 8 at 6:18

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • That synax is outdated. Try /gamemode adventure @a[distance=..100] – SpiceWeasel Jan 5 at 15:51
  • Distance does not work is there an abbreviated form of it? or a different form entirely? – Marc Jan 6 at 20:41
  • Are you using PC? I know what I did wrong there, I made it so players WITHIN the radius are changed into adventure mode. To make players outside that radius changed into adventure mode, do /gamemode adventure @a[distance=100..] if you are using PC there shouldn't be any reason for that to not work. – SpiceWeasel Jan 7 at 19:10
  • I'm on console sadly, but thank you. – Marc Jan 8 at 0:01
0

Well, it looks like you are using the 1.12 and below commands.

They updated the command syntax in 1.13, but I'll give you both.

1.13+

Put this inside a repeating command block

/gamemode adventure @a[distance=..100]

Then, right below it, put this inside another repeating command block

/gamemode <adventure/survival/creative/spactator> @a[distance!=..100]

Remember, the two dots before the one hundred is very important. It makes it so that it will change the gamemode to all players one hundred blocks away and closer. If it didn't have that, it would make it change the gamemode to all players EXACTLY one hundred blocks away.

1.12-

Put this inside a repeating command block.

/gamemode a @a[r=100]

Then, right below it, put this inside another repeating command block

/gamemode <a/s/c/sp> @a[r=100]

There you go! I hope this helps.

EDIT: Put the command blocks right in the middle of where you want the adventure radius to be.

-1

Easy /gamemode _______ @a[r=_] first blank is the gamemode, second blank is the radius away from the command block, so place it in the middle of the room.

To change the game mode after leaving the room has two options one is teleportation with a button or pressure plate. Two command block activated by the button or pressure plate. One command block will teleport the player and the other will change your gamemode /gamemode ___ @p the other option is to use an “and or” redstone circut with gamemode command blocks. One with a radius bigger than the other smaller radius cutting off the bigger one with comparators and repeaters.

  • Sorry I’m on mobile – Bratworst Jan 7 at 16:25
  • So that allows me to place any player who activates this into adventure mode, but the interest is also to get them back out once they leave the radius. – Marc Jan 8 at 0:04

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