Loot table item stacking (function set_count)

Status
Duplicate
Product/platform
Not applicable
Priority
Normal
Issue description

I am not sure if you have been asked this or not yet but I found the line of code that you need to add support from random count for items for chest loot.

I am not sure if it would be possible to add support for this in the future or not but I will provide the code for you.

"entries": [
        {
          "type": "minecraft:item",
          "weight": 20,
          "functions": [
            {
              "function": "minecraft:set_count",
              "count": {
                "min": 1.0,
                "max": 4.0,
                "type": "minecraft:uniform"
              }
            }
          ],
          "name": "minecraft:iron_ingot"
        },
        {
          "type": "minecraft:item",
          "weight": 20,
          "functions": [
            {
              "function": "minecraft:set_count",
              "count": {
                "min": 1.0,
                "max": 4.0,
                "type": "minecraft:uniform"
              }
            }
          ],
          "name": "minecraft:diamond"
        }
]

So under entries there you can add "functions" then set the "function" to "minecraft:set_count", this will then require "count" and in that "min" and "max" this is the value for how many items may stack up to for that one slot. for example diamond can stack up to 4 item for that slot (1 - 4) 

Your current generation looks like this

      "entries": [
        {
          "type": "minecraft:item",
          "name": "interstellar_exploration:unknown_elementhelmet",
          "weight": 3
        },
        {
          "type": "minecraft:item",
          "name": "interstellar_exploration:unknown_elementbody",
          "weight": 3
        }
      ]

Would it be possible to add the extra bit of support so we can generate more then one item in that slot?

Thanks in advance Klemen, keep up the great work!

Issue comments



Donate to MCreator

By donating to developers you can speed up development, as with more resources, we can dedicate more time to MCreator. It is a free project made by developers working on it in their free time.