Skip to content

Loot Bundles ‐ 1.21

DaFuqs edited this page Jul 17, 2024 · 1 revision

Loot Bundles come in all rarities. They can be used by players to get random content of a set loot table in their inventory.

loot_bundle_use.mp4

Loot Bundles use the vanilla minecraft:container_loot component.

The minecraft:container_loot Component

Key Type Effect
loot_table loot table The loot table identifier to be used for the players loot.
seed long Seed for generating the loot table. 0 or omitted uses a random seed. Setting a seed means that the generated loot will always be the same

Examples

Example: Give-Command for a Loot Bag

/give @p lootcrates:blaze_loot_bag[minecraft:container_loot={loot_table:"minecraft:chests/village/village_weaponsmith"}]

Example: Loot table dropping a Loot Bag

{
  "type": "minecraft:entity",
  "pools": [{
    "rolls": 1,
    "entries": [{
      "type": "minecraft:item",
      "name": "lootcrates:common_loot_bag",
      "functions": [
        {
          "function": "minecraft:set_components",
          "components": {
            "minecraft:container_loot": [
              {
                "loot_table": "minecraft:chests/bastion_treasure"
              }
            ]
          }
        }
      ]
    }]
  }]
}