4

When multiple target selector arguments are listed, it selects a player who only meets all the criteria listed in the target selector.

How can I make it so that the target selector is valid if at least one condition is true, not all of them?

2

You cannot do that. You have two options:

  1. Have one command per possibility.

  2. Invert the check and the arguments (not always applicable):

    /execute unless @s[tag=!a,tag=!b,tag=!c] run […]
    

That command runs if you have either tag a or tag b or tag c, because it says "do not run this if I do not have a and do not have b and do not have c, otherwise run it".

| improve this answer | |
  • In what case(s) would option 2 be inapplicable? – ExpertCoder14 May 28 at 4:45
  • Firstly, you can't for example do if(a&&b||c), secondly this doesn't work if you need it in at or facing or anything else in which the as reference needs to stay on something else. – Fabian Röling May 28 at 8:05

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.