Uploaded image for project: 'Minecraft: Java Edition'
  1. Minecraft: Java Edition
  2. MC-125058

"/execute store success" doesn't store 0 when a condition fails

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • None
    • Minecraft 18w06a, Minecraft 1.13-pre4, Minecraft 18w32a, Minecraft 1.13.1, Minecraft 1.14, Minecraft 1.14.1, Minecraft 1.14.2 Pre-Release 1, Minecraft 1.14.2 Pre-Release 2, Minecraft 1.14.2, Minecraft 1.14.3, Minecraft 1.14.4 Pre-Release 1, Minecraft 1.14.4 Pre-Release 3, Minecraft 1.14.4 Pre-Release 4, Minecraft 1.14.4 Pre-Release 5, Minecraft 1.14.4 Pre-Release 6, 1.14.4, 19w34a, 19w35a, 19w36a, 19w37a, 19w38b, 19w39a, 19w40a, 19w41a, 19w42a, 19w45b, 19w46b, 1.15 Pre-release 1, 1.15 Pre-Release 2, 1.15 Pre-release 3, 1.15 Pre-release 4, 1.15 Pre-release 5, 1.15 Pre-release 6, 1.15 Pre-release 7, 1.15, 1.15.1, 1.15.1 Pre-release 1, 1.15.2 Pre-Release 1, 1.15.2 Pre-release 2, 1.15.2, 20w06a, 20w07a, 20w08a, 20w09a, 20w10a, 20w11a, 20w13a, 20w13b, 20w15a, 20w17a, 20w18a, 20w19a, 20w20a, 20w20b, 20w21a, 1.16 Pre-release 3, 1.16 Release Candidate 1, 1.16, 1.16.1, 20w28a, 20w30a, 1.16.2 Pre-release 1, 1.16.2 Release Candidate 1, 1.16.2 Release Candidate 2, 1.16.2, 1.16.3 Release Candidate 1, 1.16.3, 1.16.4 Pre-release 1, 1.16.4 Pre-release 2, 1.16.4 Release Candidate 1, 1.16.4, 20w46a, 20w48a, 20w51a, 21w03a, 1.16.5, 21w05a, 21w05b, 21w06a, 21w07a, 21w11a, 21w18a, 1.17 Pre-release 2, 1.17.1, 1.19, 1.19.2, 23w03a, 23w05a, 23w06a, 23w07a, 1.19.4 Pre-release 2, 1.20.1, 23w31a, 23w32a, 23w33a, 1.20.2 Pre-release 1, 1.20.2, 23w41a, 23w42a, 23w43a, 23w44a, 1.21 Release Candidate 1, 1.21, 24w40a, 24w44a
    • Confirmed
    • Commands
    • Normal
    • Platform

      The bug

      It seems that if a condition in the execute command fails, then the "success" value is not set to 0 when using execute store success.

      Setup

      /scoreboard objectives add was_successful dummy
      /scoreboard objectives add some_score dummy
      /scoreboard objectives setdisplay sidebar was_successful
      
      • was_successful will keep track of what /execute store does. We will set the sidebar to show this value.
      • some_score is a simple score we can change

      How to reproduce

      Method 1

      We'll set was_successful to 0 so we can observe a change in value.
      Lets set some_score to 1, to start with

      /scoreboard players set @s was_successful 0
      /scoreboard players set @s some_score 1
      

      Now, on running the following command, you'll see was_successful got set to 1, and the text was printed in chat. This is expected.

      /execute store success score @s was_successful if entity @s[scores={some_score=1}] run say some_score is 1
      

      Now let's set was_successful to a bogus value (say, 100) so we can observe any changes.
      This time, some_score is set to 0, so the above command will not match

      /scoreboard players set @s was_successful 100
      /scoreboard players set @s some_score 0
      

      Run the above execute store command again.
      Observe that was_successful did not change. I expect its value to be 0 at this point.

      Method 2

      Another way to reproduce the bug is described in this comment.

            Unassigned Unassigned
            simon816 Simon816
            Votes:
            22 Vote for this issue
            Watchers:
            15 Start watching this issue

              Created:
              Updated:
              CHK: