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

Scoreboard modulo gives incorrect results with negatives

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Works As Intended
    • None
    • 1.15.2
    • None
    • Unconfirmed
    • (Unassigned)

      At some point it appears that the division type was changed for modulo and now gives different results.

      Operations such as:
       -5 %= 4 should result in -1, but now results in 3

      Steps to reproduce:
      1. Create scoreboard "name"
      2. Add target player "x" with negative score eg. -5 and selector player "y" with a positive score eg. 4
      3. /scoreboard players operation "x" "name" %= "y" "name"

      the result is 3 when it should be -1

            Unassigned Unassigned
            MukiTanuki MukiTanuki
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: