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

Enabling uninitialized trigger also sets score to 0

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Resolution: Works As Intended
    • Affects Version/s: Minecraft 1.10.2, Minecraft 16w36a, Minecraft 1.12.2, Minecraft 18w03b
    • Fix Version/s: None
    • Confirmation Status:
      Confirmed

      Description

      The bug

      When you enable a trigger scoreboard objective for a player who has no score for it yet, the value is initialized to 0. This can cause problems if you use 0 as a value for an action.

      The use for it might be to tell that a trigger objective was enabled, but in this case any scoreboard command changing the value before the test happens negates this use.

      How to reproduce

      1. /scoreboard objectives add triggerObjective trigger
      2. /scoreboard players list @p
        triggerObjective is not shown
      3. /scoreboard players enable @p triggerObjective
      4. /scoreboard players list @p
        triggerObjective is shown with a value of 0

      Additional comment

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                dinnerbone [Mojang] Nathan Adams
                Reporter:
                marcono1234 [Mod] Marcono1234
              • Votes:
                4 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  CHK: