For your first try, only the last argument of the same scoreboard will be used, which is myScore=3, others will be ignore.
For your second try, "When the player has a score of 1 and a score of 3." But the fact is, player can have only one score under the same scoreboard.
Unless you are using if to detect a range of score, and define the exception in the sub-command using unless or !, there is no way to do this in one command without separating. However, unless and @s cannot be used since the executor is unknown, as should take the place of if in order to let @s to work.
There you go, all in one command. But most of the time, using tags or just separating commands is recommended.
execute as @a[scores={myScore=1..3}] unless entity @s[scores={myScore=2}] run say found...
I want to get entities with a score of 1 or 3 but not 2 in one selection
I tried:
But that only got me entities with a score of 2 and:
gives me an error
Just try it with two seperate commands.
Like,
EDIT: Sorry just realised that you wanted it in one command, just wondering... why?
Please, everyone, if your post is solved, edit the name and mark it [SOLVED]. Period.
For your first try, only the last argument of the same scoreboard will be used, which is myScore=3, others will be ignore.
For your second try, "When the player has a score of 1 and a score of 3." But the fact is, player can have only one score under the same scoreboard.
Unless you are using if to detect a range of score, and define the exception in the sub-command using unless or !, there is no way to do this in one command without separating. However, unless and @s cannot be used since the executor is unknown, as should take the place of if in order to let @s to work.
There you go, all in one command. But most of the time, using tags or just separating commands is recommended.
execute as @a[scores={myScore=1..3}] unless entity @s[scores={myScore=2}] run say found...