You can use scoreboard in player selectors to find out which one they clicked. Usually this is done by either testfor
or execute
.
I recommend a 20 t/s clock to check these as soon as they click it. You don't have to use one, but it may help. great method to setup one.
In the case of testfor, it is actually not recommended to use it. You can't exactly distinguish which player clicked it, you just know that it was clicked. A better way is the execute method. Never-the-less, the command should look like this:
Testfor @a[score_test=1,score_test_min=1]
You will need a comparator to get if it succeeded to find it. You should also have a separate command block for each, then change the 1
to another number for each possible outcome.
In the case of execute: recommended method. You can use @p in the command
part to target that specific player. Command as follows:
Execute @a[score_test=1,score_test_min=1] ~ ~ ~ <command>
For this, you should set their score of that to 0 as soon as the command is run, otherwise that command may be run twice.
The syntax of execute detect
is:
/execute <entity> <x> <y> <z> detect <x> <y> <z> <block> <dataValue> <command>
You have got an extra 0 after the dataValue
, which Minecraft thinks is meant to be the command. Try:
/execute @a ~ ~ ~ detect ~ ~-1 ~ minecraft:wool 1 tp @a[c=1] 0 0 0
I've also switched the @p
for an @a[c=1]
. This is because @a
will select dead/alive players, but @p
will not. If a player were to die on orange wool with the original command, they would keep teleporting the nearest alive player to those coordinates.
Best Answer
Simply change the objective type to
stat.teamkill.dark_red (or other color)
Place the juggernaut on a team and set that team's color to match the objective criteria
When you end the game, use the selector
@p[score_Juggernaut_min=1]
to find out who won.