# How to set everyone in a certain area, except myself, in adventure mode?

I'm trying to set up a command that sets everyone in a 27 by 27 square into adventure mode with the exception of myself.

`/gamemode adventure @a[name=!JP2K],[distance=..27,]`

This didn't work, and even if it did, the distance command is only a radius, so that doesn't help much either.

Help would be much appreciated!

Here is a command that might work.

``````/gamemode adventure @a[x=1,y=2,z=3,dx=4,dy=5,dz=6,name=!JP2K]
``````

Replace 1,2,3 with the x,y,z of the search center. Basically where you want to start with the search radius which is 4,5,6. Replace 4 with how far out on the X axis you want to go. Replace 5 with how far out on the Y axis you want to go. Replace 6 with how far out on the X axis you want to go. Hope this helps! :)

No brackets around the comma and no comma before the closing bracket:

``````/gamemode adventure @a[name=!JP2K,distance=..27]
``````

I recommend looking up a commands tutorial or at least example commands instead of guessing the syntax.

• i thought the distance command is a radius and not an area?
– JP2K
Mar 28, 2019 at 18:37
• /gamemode adventure @a[name=!JP2K,distance=..27] this is the correct syntax i believe. but it is still a radius command not an area command
– JP2K
Mar 28, 2019 at 18:43
• `name=!JP2K`, not `nameR!JP2K` Jun 22, 2019 at 16:00
• @pppery Thanks. I didn't press the button long enough on my phone keyboard. There was also a `[` instead of the second `=`, that's fixed now as well. Jun 22, 2019 at 16:36

• the issue with this is that `distance` indicates a circular area, not a square area. you'd need to use the `x= y= z= dx= dy= dz=` method instead. Apr 4, 2019 at 1:06