Star Hype News.

Premium celebrity moments with standout appeal.

general

How do I force a particular gamemode only within a radius? [duplicate]

By James Williams

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!

4

2 Answers

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.

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.

2