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

LootTable does not respect rolls

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Minecraft 15w44a
    • Minecraft 15w43c
    • None
    • Confirmed

      If I do

      {
          "pools": [
              {
                  "rolls": 27,
                  "entries": [
                      {
                          "type": "item",
                          "name": "minecraft:book",
                          "weight": 1,
                          "functions": [
                              {
                                  "function": "enchant_with_levels",
                                  "levels": 30,
                                  "treasure": true
                              }
                          ]
                      }
                  ]
              }
          ]
      }
      

      which has 27 rolls, I expect all 27 slots in the chest filled. Instead I get like 14-18.

      The same thing happens with 27 copies of "roll:1". Seems like a roll will 'randomly replace' existing items.

      This makes the feature nearly useless to mapmakers; you can no longer specify the loot. Surely this is not how it's intended to work?

      (Someone suggested the code is currently

      inventory.getSlot(rant.nextInt(inventory.length));

      I think it should only select among the empty slots, and if there are no empty slots left, I don't care too much what the behavior is (don't specify tables with more than 27 rolls).)

            Unassigned Unassigned
            brianmcn Brian McNamara
            Votes:
            3 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:
              CHK: