I am making a minigame when two players are needed to start an arena !
Trying with the c
selector for count, but it seems that doesn't work
This is the command I used:
/testfor @a[score_arena_min=1,score_arena=1,c=2]
The arena scoreboard notes the players who joined an arena, the 1 value being for arena 1.
Can someone give me another solution than that?
Best Answer
The
c
parameter is to limit the maximum number of targets to obtain rather than a minimum. For example, if there were 3 possible matches whilec
was set to 2, only the 2 closest would be selected. If there were only 1 target possible, then only that target is obtained.Since you know the exact score and number of players you want to look for, you can check the command block's
SuccessCount
integer tag value without changing the command you're using. If it's 0, then no players were found. If it's 1, then only 1 player was found. If it's 2, then 2 (or more) players were found with that score.The command you're currently running which will set the command block's success count appropriately.
Check the command block's
SuccessCount
value to ensure it is 2. Modify the XYZ coordinates to target the repeating block.Conditional. Action to perform as a result of there being at least 2 players that matched.