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:
- Start a new world and give yourself a command block.
- Type in the command say @p[score_Foo-bar=44]
- Power the command block and it should say your name.
- Click on the command block and remove the "-" so it should now be say @p[score_Foobar=44]
- Power the command block again and notice how it doesn't say your name this time.
Environment
- Windows 7 x64,
- Java version: Version 7 Update 21
Created Issue:
If an objective name has "-" in it, the argument for seeing if anyone has a score doesn't work
I've found that, with scoreboard objectives, if the objective has a dash ("-") in the name, then the score argument for command blocks won't work to see if anyone has the score.
Environment
- Windows 7 x64,
- Java version: Version 7 Update 21
I've found that, with scoreboard objectives, if the objective has a dash ("-") in the name, then the score argument for command blocks won't work to see if anyone has the score.
To reproduce:
- Start a new world and give yourself a command block.
- Type in the command say @p[score_Foo-bar=44]
- Power the command block and it should say your name.
- Click on the command block and remove the "-" so it should now be _say @p[score_Foobar=44]
- Power the command block again and notice how it doesn't say your name this time.
I've found that, with scoreboard objectives, if the objective has a dash ("-") in the name, then the score argument for command blocks won't work to see if anyone has the score.
To reproduce:
- Start a new world and give yourself a command block.
- Type in the command say @p[score_Foo-bar=44]
- Power the command block and it should say your name.
- Click on the command block and remove the "-" so it should now be
_say @p[score_Foobar=44]- Power the command block again and notice how it doesn't say your name this time.
I've found that, with scoreboard objectives, if the objective has a dash ("-") in the name, then the score argument for command blocks won't work to see if anyone has the score.
To reproduce:
- Start a new world and give yourself a command block.
- Type in the command say @p[score_Foo-bar=44]
- Power the command block and it should say your name.
- Click on the command block and remove the "-" so it should now be say @p[score_Foobar=44]
- Power the command block again and notice how it doesn't say your name this time.
If an objective name has "-" in it,the argument for seeing if anyone has a score doesn't workIf an objective name has "-" in it, command block ignores parameters
If an objective namehas"-" in it, command block ignores parametersObjective 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 won't work to see if anyone has the score.
To reproduce:
- Start a new world and give yourself a command block.
- Type in the command say @p[score_Foo-bar=44]
- Power the command block and it should say your name.
- Click on the command block and remove the "-" so it should now be say @p[score_Foobar=44]
- Power the command block again and notice how it doesn't say your name this time.
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:
- Start a new world and give yourself a command block.
- Type in the command say @p[score_Foo-bar=44]
- Power the command block and it should say your name.
- Click on the command block and remove the "-" so it should now be say @p[score_Foobar=44]
- Power the command block again and notice how it doesn't say your name this time.
duplicates
relates to
duplicates
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:
- Start a new world and give yourself a command block.
- Type in the command say @p[score_Foo-bar=44]
- Power the command block and it should say your name.
- Click on the command block and remove the "-" so it should now be say @p[score_Foobar=44]
- Power the command block again and notice how it doesn't say your name this time.
Objective names with "-" in it are consideredinvalidObjective names with "-" in it are always considered valid regardless if the criteria is met or not
Objective names with "-" in it arealwaysconsidered validregardless if the criteria is met or notObjective names with "-" in it are considered invalid
duplicates




Cannot confirm, command block works fine with the objective name magic-pie and the command
successfully outputs
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/crash-reports/crash-<DATE>-client.txt) here.
In that case, confirmed, but a duplicate ofMC-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.
Confirmed on 1.8.1-pre3.
This bug is probably related to
MC-73729.