mojira.dev
MC-301479

Nonsensical syntax for scores in target selector is valid

execute if entity @s[scores={=1}]

Was messing around with brigadier trying to recreate Minecraft’s command parsing for an external program I’m working on and bumped across this edge case. As far as I can tell, this happens because the method (presumably) used to parse the objective name, StringReader.ReadUnquotedString(), accepts empty strings. This method is used elsewhere (for parsing brigadier:string), but only here does it behave this way.

This command runs, and the target selector effectively filters out all entities, as no objective with an empty name exists. I expected it to fail to parse at all. There are probably other places where StringReader.ReadUnquotedString() is used like this and causes similar problems.

Attachments

Comments 0

No comments.

CzarBatata

(Unassigned)

Confirmed

(Unassigned)

1.21.8

Retrieved