I have a map that I'm making where players can choose a class but each class has certain restrictions. I am trying to find a way to set it so that if a player picks, let's say, Knight, they cannot use a bow.
I know most of the commands but my issue is having the bow only removed from the inventory of the player that chose the knight class and not any other.
Would this – clear @a[score_knight_min=1] minecraft:bow
– command work so that if the player has a min score of 1 in that classes dummy score it would only remove the item from that specific player and NOT every player on the map? I would check my self but I have no way of testing it without a second player on my map.
Best Answer
Yes.
That is exactly how target selector variables and arguments work:
Target selectors are resolved as a whole. While
@a
would target every player regardless of, well, everything,@a[arg1=value1,arg2=value2]
will only target those players satisfyingarg1=value1
andarg2=value2
.Note that a non-sensical argument is always fulfilled, that is, any that are not listed under target selector arguments, including misspelled or wrongly capitalized arguments:
@a[Name=Bob]
will target all players, sinceName
is not valid (butname
is).