If a player is standing at this location, I want their score to be set to 1 on objective inSpawn. Help.

  • This time it was answered, next time please do at least a little bit of research yourself. Nov 10 '17 at 7:27

This solution uses 2 command blocks in a chain. The first command block resets the score for all players. The second command block sets the score to 1 for all players within a specified radius from the specified coordinates. Minecraft Java Edition version is currently 1.12.2.

The first command block is RepeatUnconditionalAlways Active with command:

scoreboard players reset @a inSpawn

The second command block is ChainUnconditionalAlways Active with command:

scoreboard players set @a[x=X,y=Y,z=Z,r=R] inSpawn 1

Replace X, Y, and Z with the coordinates. Replace R with the desired radius. The radius will determine how large of an area it will accept players. You can instead use volume arguments in the target selector if you want to specify the area.

  • Using the <key> tag for the command block GUI buttons, good idea! Nov 10 '17 at 7:26
  • @Fabian The tag used was <kbd></kbd>. I figured they represent user input as buttons and it makes it stand out in the answer. I found the page on allowed HTML tags a while back. I experimented with several of the tags in the hopes of improving my answer formatting and clarity.
    – IronAnvil
    Nov 10 '17 at 16:12

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