You can use the /stats
or check the CommandStats
datatag of the ArmorStand
. I highly recommend use of the /stats
command.
Extract the result:
Run these commands once
Note: Anything suffixed with a "_v" can be whatever you want, as long as they're consistent.
/scoreboard objectives add SuccessCount_v dummy
/stats entity @e[type=ArmorStand,name=Lexer] set SuccessCount @e[type=ArmorStand,name=Lexer] SuccessCount_v
This will store the SuccessCount (in case of this command, 0 or 1) in the scoreboard as @e[type=ArmorStand,name=Lexer] SuccessCount_v
, which you can then test and use as you would any other scoreboard value.
Add results together:
I'm not going to go into detail here, since I am unsure exactly you want to add together. I will, however link you to a wiki page where you can find the format of /scoreboard players operation <selector> <objective> <operator> <selector2> <objective2>
, the only method for doing math in command blocks. (Yes, there is a command dedicated to it. It is not impossible.)
Hope this helps and wish you luck!
If I understood well, you want the /spreadplayers
command, which teleports players to random places inside a specified area in a command:
/spreadplayers <x> <z> <spreadDistance> <maxRange> <respectTeams> <player>
x
, z
: The middle of the area you want to teleport players (press F3 to see coordinates)
spreadDistacnce
: The minimum distance between teleported players
maxRange
: The maximum teleport distance from the x and z coordinates
respectTeams
: True or false. When true, targets on the same team will be teleported to the same location.
player
: The selector of what you want to teleport, eg. @p
Example:
/spreadplayers 0 0 1 10 false @a
This will teleport all players to random locations, but at least 1 block away, from x = -10 and z = -10 to x = 10 and z = 10.
Example 2 (requested in the comments):
/spreadplayers 100 100 0 5 false @r[x=0,y=60,z=0,r=10]
This command will teleport a random player that was less then 10 blocks away from XYZ 0, 60, 0 to a random location within 5 blocks of X, Z 100, 100.
For more information about the /spreadplayers
command, visit the Minecraft Wiki or the Minecraft Forum
Best Answer
The easiest way to do this would be to repeat the command a few times and target all players who are either within the inner circle or outside of the outer circle (which is possible due to
/spreadplayers
' spread area being a square). If you let this run for 5 seconds in a repeating command block, you have 100 attempts to get them out, which should make it sure enough that nobody's left there.If you know the number of players (or teams), you can also play around with the
spreadDistance
parameter by setting it high enough that players can only end up in a ring. For example the command/spreadplayers ~ ~ 11 9 false @e[type=armor_stand]
does a pretty good job of spreading five armor stands evenly in a ring.