Mojira Archive
MCM-1616

execute if/unless score fails if the score is not set

Partner Rank:
2

Partner Team Reporting:
Everbloom Games

Verification builds:
1.19.60

Summary:
The execute if/unless score subcommands automatically halt execution of the command if the score being compared is not set. (same as MCPE-156279)

Impact:
This is unintuitive behavior and breaks parity with Java Edition. You'd expect `unless` to act as the complete opposite of `if`, but when the score is not set, both fail.
We'd normally use `execute unless score` to run initialization code, but we can't do this due to this bug, and have to rely on other, less readable methods.

Repro Steps:

  1. Create an objective. For this example, "foo".
  2. Run:
execute unless score FAKE_PLAYER foo matches 0.. run say score not set

Observed Results:

The command fails.

Expected Results:

It should say "score not set" in chat, as the subcommand succeeded. The logic would beĀ  along the lines of "unless (the score is set AND is >= 0)", rather than failing entirely.

Regression Build:

N/A

Screenshots / Videos Attached:

No

Unresolved

Energyxxer

2022-12-15, 06:22 PM

2023-02-20, 08:41 PM

3

3

-

-