0

This is my command, it should only activate if all players have avance score on 0:

/execute if entity @a[scores={avance=0}]

I thought that with @a it would only be true if ALL players have that condition, but the command block output says "Test Passed, count 1" and that screws up the whole circuit as it depends on the command output being "Test Passed" only when all players have the same score on 0 to work.

1

There are multiple solutions, the easiest is to check if no player does not fulfill the condition:

/execute unless entity @a[scores={avance=1..}] unless entity @a[scores={avance=..-1}]

You can also add limit=1 to both of these selectors to improve performance. Thanks to vdvman1 for this tip.

| improve this answer | |
  • it does not work, it says there is an error at "avance <--[HERE]" , expected "=", as soon as i type "!" the code turns red – D3T0NA Nov 1 '19 at 14:42
  • Oh sorry, I was used to Java (and pretty much every other programming language), where it's "!=". In Minecraft it's "=!" (for whatever reason). I corrected the command. – Fabian Röling Nov 1 '19 at 15:11
  • i do not know why but it turns red with both "!=" and "=!" – D3T0NA Nov 1 '19 at 16:52
  • you told me there are multiple solutions, do you know what else i can try? – D3T0NA Nov 1 '19 at 16:52
  • I'll try it in the game now, I wasn't at a computer so far. Another solution would be to tag all matching players and see if someone without the tag is left. – Fabian Röling Nov 1 '19 at 20:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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