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 1

Thank you for your report!
After consideration, the issue is being closed as Won't Fix.

Please note that this is not the same as Working as Intended, as this bug report correctly describes behavior in the game that might not be the intended or desirable behavior, but it will not be fixed right now. Sometimes, this is because the issue reported is minor and/or impossible to change without large architectural changes to the code base.

Quick Links:
📓 Bug Tracker Guidelines – 💬 Community Support – 📧 Mojang Support (Technical Issues) – 📧 Microsoft Support (Account Issues)
📓 Project Summary – ✍️ Feedback and Suggestions – 📖 Game Wiki

CzarBatata

(Unassigned)

Confirmed

(Unassigned)

1.21.8

Retrieved