Mojira Archive
MC-91310

LootTable does not respect rolls

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).)

Fixed

Brian McNamara

2015-10-24, 05:37 PM

2015-10-30, 10:04 PM

2015-10-28, 11:01 PM

3

2

Confirmed

Minecraft 15w43c

Minecraft 15w44a