mojira.dev
MC-28230

Objective names with "-" in it are considered invalid

I've found that, with scoreboard objectives, if the objective has a dash ("-") in the name, then the score argument for command blocks will treat it as invalid, which also displays MC-9097.

To reproduce:

  1. Start a new world and give yourself a command block.

  2. Type in the command say @p[score_Foo-bar=44]

  3. Power the command block and it should say your name.

  4. Click on the command block and remove the "-" so it should now be say @p[score_Foobar=44]

  5. Power the command block again and notice how it doesn't say your name this time.

Linked issues

Attachments

Comments 8

Cannot confirm, command block works fine with the objective name magic-pie and the command

say @p[score_magic-pie=3] has 3 magic pies

successfully outputs

[@] GrygrFlzr has 3 magic pies

Not to mention, your first screenshot contradicts your description.

@GrygrFlzr does the objective "magic-pie" exist?

If by first screenshot you mean dashcommandoutput.png, see no_objectives_players.png.

The command block shouldn't say anyone has a score because the objective doesn't exist.

I have also edited the description for clarity.

Please force a crash by pressing F3 + C for 10 seconds while ingame and attach the crash report ([minecraft|http://hopper.minecraft.net/help/finding-minecraft-data-folder]/crash-reports/crash-<DATE>-client.txt) here.

In that case, confirmed, but a duplicate of MC-9097 (which will be re-opened soon). Your original wording was mildly confusing.
After some thought this counts as a separate bug.

Confirmed. The command will output regardless of whether the objective exists, whether I have any points in it, whether I check for "score_Foo-bar_min" instead, etc. - it always outputs success. Objectives without "-" in the name do not exhibit this behavior.

Confirmed on 1.8.1-pre3.

This bug is probably related to MC-73729.

NeedAGoodUsername

(Unassigned)

Confirmed

command, command_block, objective, objectives, scoreboard

Minecraft 1.6.2, Minecraft 1.8.1-pre3

Retrieved