mojira.dev
MC-101037

Cannot use !Tag when searching for multiple scoreboard tags.

I've searched the web and found no mention of whether or not using ! to find entities without a tag works. I find it very strange that it works within the @e selector, but not in the curly brackets. I've tested it quite a bit and believe I have not missed anything major (Other than if it's supposed to work in the first place)

I've found that using
/scoreboard players tag @a add Test {Tags:["!Test"]}
Does not work but using
/scoreboard players tag @a[tag=!Test] add Test
does.

Obviously, this is an example that uses only one tag, but it is very much needed to have multiple !s in one of the projects I'm working on and I wish to know if it's something I will have to work around or not,

I've also tested the following commands, and both works, so that means that my syntax is not incorrect.
/scoreboard players tag @a add Test
/scoreboard players tag @a remove Test {Tags:["Test"]}

Thank you

Comments 3

Because you have no tag that's named "!Test".
The negation ( ! ) only works in selectors.

So, it's intended that ! cannot be used in curly brackets? Why is that?

Because the cannot negate NBT data, it's never been introduced, and has only been introduced in the selectors, asking for it to work in NBT data is a feature request.

Daniel Bradley

(Unassigned)

Unconfirmed

Minecraft 16w15b

Retrieved