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

Loss of precision in entity_scores conditions

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Resolution: Fixed
    • Affects Version/s: 1.15.2, 20w06a, 20w07a, 20w08a, 20w09a, 20w10a, 20w11a, 20w12a, 20w14a, 20w16a, 20w17a, 20w18a, 20w20b, 1.16 Pre-release 5, 1.16.1, 1.16.2 Pre-release 1, 1.16.2 Release Candidate 1, 1.16.2, 1.16.3, 1.16.4 Pre-release 1, 1.16.4, 20w45a
    • Fix Version/s: 20w46a
    • Labels:
    • Confirmation Status:
      Confirmed
    • Category:
      Loot tables

      Description

      The bug

      entity_scores conditions cannot express all possible ranges of ints because they use RandomValueBounds that its min and max are floats.
       

      How to reproduce

      1. /scoreboard objectives add _ dummy
      2. /scoreboard players set @s _ 16777216
      3. /execute if predicate _

        Test passed

      4. /scoreboard players set @s _ 16777217
      5. /execute if predicate _

        Test passed

      •  data/minecraft/predicates/_.json
        {
            "condition""minecraft:entity_scores",
            "scores": {
                "_": 16777216
            },
            "entity""this"
        }
        

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              intsuc intsuc
              Votes:
              9 Vote for this issue
              Watchers:
              7 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                CHK: