I am trying to testfor if a player fulfills two different criteria. One criteria cannot be changed and is: score_money=5000
. I have tried to come up with another criteria to target a very specific player. For example I've tried:
/testfor @p[tag=buyHSR,score_money=5000]
/testfor @p[l=30,score_money=5000]
/testfor @p[score_buy=1,score_money=4500]
The problem, all of these commands work on singleplayer, and not on multiplayer. What happens on multiplayer is that it will testfor the score_money=500
of the nearest player and execute the following commands despite whether or not that same player has the score_buy=1
tag. So, if I am closest to the command blocks and have insufficient money
but my friend has enough, who is farther away, the selector will find my friend but execute the commands for me. (This causes my money
score to reach into the negatives). In summary, the target selector favors one criteria over the other depending on who has one of the criteria. I am trying to get a selector that will succeed only if both citeria are met.
I am running Minecraft 1.12.2.
/scoreboard players tag @s add test
,/scoreboard players tag @s add abc
,say @s[tag=test,tag=abc]
. What do you get?/testfor @p[score_buy=1,score_money=5000,l=30,tag=buyHSR]
and it functions successfully. I am not sure how/who it would target in multiplayer. One more thing to point out, score_money=5000 is going to target players who have a score of 5000 or less. Here is the wiki on selecting targets by score. You said it targets correctly if you remove one of the arguments so I doubt it's a problem but just incase.