I'm making a survival map and I have this hopper section where you have to collect certain items. However, I want to turn the player into Adventure Mode so they can't break any blocks to not mess up the redstone. I could easily do it in 1.12 with the "radius" option in a command, which they removed for 1.13 and replaced it with the "distance=?..?" command. If I could get someone's help, that would be greatly appreciated

(I did find two articles for 1.12 - Is there a way to set an "Adventure Mode Boundary" in Minecraft? and Is there a way to set an "Adventure Mode Boundary" in Minecraft?. They are asked the same question, but have been provided different answers.)

  • 1
    What makes you think the functionality of them would be different? They sound like they could be the same just named differently. Radius is the distance between the center and edge of a circle, have you tried using the distance command to see if it reacts differently? In general, questions like this will always be downvoted and wont illicit good answers because you havent shown people what youve tried. Thats great you did some research! But actually give the commands a try first. If they still dont work, then people can actually help. – Kyle Rone Jul 30 '18 at 20:22
  • Questions should not be reasked because the current answer is outdated. Instead, that answer should be updated and a new one should be posted. – pppery 9 hours ago
  • 2
  • Correction to my first comment: should have been or a new one should be posted. – pppery 5 hours ago

It's difficult to tell what exactly the problem is, so I'll give a general explanation of the new 1.13 selectors. The best way to explain yourself in the future is to include an example of what you tried, explain what the example does wrong, then explain what you want it to do.

In 1.12, selectors had a lot of "paired" options, such as radius max (r=) and radius min (rm=) or XP max (l=) and XP min (lm=). These options could be used together to form a specific range, or independently as minimums and maximums.

In 1.13, these "paired" selectors have been replaced with a version of ellipsis (..). They're used in the mathematical sense, to describe a continuation of a pattern, in Minecraft's case a range of numbers such as 3..6 to say 3, 4, 5, and 6 (along with everything in between). They can also be used independently to form minimums and maximums like in 1.12. To use your use case as an example, gamemode 2 @a[distance=..10] will change the gamemode of all players within ten blocks (..10) to adventure.

In order to make a proper boundary, you would also want to set players to a different gamemode when they are outside of the barrier. In this case, we'd want 10 as the minimum and some other somewhat-arbitrary number as a maximum. I would use gamemode 0 @a[distance=10..14]

(PS, to avoid spam in the players' chat, add a gamemode restriction to the above commands. gamemode 2 @a[gamemode=survival,distance=..10])

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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