Mojira Archive
MCPE-156279

'/execute (if|unless) score' cannot compare scores that are not set

The bug

With the new /execute command syntax, the sub-commands if score and unless score should be able to compare scores to players that don't have their scores set. This does not work, however; an error is returned about how there is no tracked player on the scoreboard, which does not line up with behavior in Java Edition.

In Java Edition, /execute (if|unless) score can compare scores that aren't set and is often used for initializing scores. Comparing an undefined score to a value always returns false.

Steps to reproduce:

  • Create a new scoreboard objective and set some score on it. I'll be using a fake player named "one".
    /scoreboard objectives add foo dummy
    /scoreboard players set one foo 1
    
  • Compare your currently undefined score to the "one" score.
    /execute if score @s foo = one foo
    

"There is no tracked player '<player>' on the scoreboard; Execute subcommand if score test failed."

Unresolved

Sprunkles

2022-05-25, 08:30 PM

2023-09-17, 07:12 AM

6

2

Confirmed

796996

1.19.60.25 Preview - 1.20.40.21 Preview1.19.60.25 Preview, 1.19.50.20 Preview, 1.19.10.20 Preview, 1.19.10, 1.19.30.20 Preview, 1.19.20, 1.19.50.24 Preview, 1.19.41, 1.19.51, 1.20.15 Hotfix, 1.20.40.21 Preview

-