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

Weight on alternatives/sequence/group loot table entry is ignored

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Works As Intended
    • None
    • 1.15.2, 20w18a, 20w20b, 20w22a, 1.16.3
    • None
    • Confirmed
    • Loot tables

      In this bug report I will only use "alternatives", but know that it applies to all three.

      The bug

      A loot table entry of type "alternatives", "group", or "sequence" ignores the weight. It acts as if it has the default weight of 1.

      Stranger, if you give the children of the alternatives entry a weight, it acts as if the weight was given to the alternatives entry. So it appears as if the children of alternatives are processed before a random entry is chosen in the parent entry.

      How to reproduce

      1. Download and install the attached data pack
      2. Run "/loot give @s loot mc-177500:a" a few times
      3. Notice that you get about as many diamonds as emeralds
      4. Run "/loot give @s loot mc-177500:b" a few times
      5. Notice that you get about 9 diamonds for each emerald

      Examples (simplified)

      mc-177500:a mc-177500:b
      "entries": [
        {
          "type": "alternatives",
          "weight": 9,
          "children": [
            {
              "type": "item",
              "name": "diamond"
            }
          ]
        },
        {
          "type": "item",
          "name": "emerald"
        }
      ]
      
      "entries": [
        {
          "type": "alternatives",
          "children": [
            {
              "type": "item",
              "name": "diamond",
              "weight": 9
            }
          ]
        },
        {
          "type": "item",
          "name": "emerald"
        }
      ]
      

            Unassigned Unassigned
            Misoloo [Helper] Misode
            Votes:
            11 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:
              CHK: