{
  "type": "minecraft:chest",
  "random_sequence": "repurposed_structures:chests",
  "pools": [
    {
      "rolls": 1,
      "entries": [
        {
          "name": "minecraft:golden_apple",
          "type": "minecraft:item",
          "weight": 20
        },
        {
          "name": "minecraft:enchanted_golden_apple",
          "type": "minecraft:item"
        },
        {
          "name": "minecraft:smithing_table",
          "type": "minecraft:item"
        },
        {
          "name": "minecraft:name_tag",
          "type": "minecraft:item",
          "weight": 30
        },
        {
          "name": "minecraft:book",
          "type": "minecraft:item",
          "weight": 10,
          "functions": [
            {
              "function": "minecraft:enchant_randomly"
            }
          ]
        },
        {
          "name": "minecraft:iron_pickaxe",
          "type": "minecraft:item",
          "weight": 5
        },
        {
          "type": "minecraft:empty",
          "weight": 5
        }
      ]
    },
    {
      "rolls": {
        "min": 2.0,
        "max": 4.0,
        "type": "minecraft:uniform"
      },
      "entries": [
        {
          "name": "mysticalagriculture:iron_essence",
          "type": "minecraft:item",
          "weight": 10,
          "functions": [
            {
              "function": "minecraft:set_count",
              "count": {
                "min": 1.0,
                "max": 5.0,
                "type": "minecraft:uniform"
              }
            }
          ]
        },
        {
          "name": "mysticalagriculture:gold_essence",
          "type": "minecraft:item",
          "weight": 5,
          "functions": [
            {
              "function": "minecraft:set_count",
              "count": {
                "min": 1.0,
                "max": 3.0,
                "type": "minecraft:uniform"
              }
            }
          ]
        },
        {
          "name": "mysticalagriculture:redstone_essence",
          "type": "minecraft:item",
          "weight": 7,
          "functions": [
            {
              "function": "minecraft:set_count",
              "count": {
                "min": 4.0,
                "max": 9.0,
                "type": "minecraft:uniform"
              }
            }
          ]
        },
        {
          "name": "mysticalagriculture:lapis_lazuli_essence",
          "type": "minecraft:item",
          "weight": 7,
          "functions": [
            {
              "function": "minecraft:set_count",
              "count": {
                "min": 4.0,
                "max": 9.0,
                "type": "minecraft:uniform"
              }
            }
          ]
        },
        {
          "name": "mysticalagriculture:diamond_essence",
          "type": "minecraft:item",
          "weight": 3,
          "functions": [
            {
              "function": "minecraft:set_count",
              "count": {
                "min": 1.0,
                "max": 2.0,
                "type": "minecraft:uniform"
              }
            }
          ]
        },
        {
          "name": "mysticalagriculture:coal_essence",
          "type": "minecraft:item",
          "weight": 10,
          "functions": [
            {
              "function": "minecraft:set_count",
              "count": {
                "min": 3.0,
                "max": 8.0,
                "type": "minecraft:uniform"
              }
            }
          ]
        },
        {
          "name": "minecraft:glow_berries",
          "type": "minecraft:item",
          "weight": 15,
          "functions": [
            {
              "function": "minecraft:set_count",
              "count": {
                "type": "minecraft:uniform",
                "min": 3.0,
                "max": 6.0
              },
              "add": false
            }
          ]
        },
        {
          "name": "minecraft:sweet_berries",
          "type": "minecraft:item",
          "weight": 15,
          "functions": [
            {
              "function": "minecraft:set_count",
              "count": {
                "min": 1.0,
                "max": 3.0,
                "type": "minecraft:uniform"
              }
            }
          ]
        },
        {
          "name": "minecraft:melon_seeds",
          "type": "minecraft:item",
          "weight": 10,
          "functions": [
            {
              "function": "minecraft:set_count",
              "count": {
                "min": 2.0,
                "max": 4.0,
                "type": "minecraft:uniform"
              }
            }
          ]
        },
        {
          "name": "minecraft:pumpkin_seeds",
          "type": "minecraft:item",
          "weight": 10,
          "functions": [
            {
              "function": "minecraft:set_count",
              "count": {
                "min": 2.0,
                "max": 4.0,
                "type": "minecraft:uniform"
              }
            }
          ]
        },
        {
          "name": "minecraft:beetroot_seeds",
          "type": "minecraft:item",
          "weight": 10,
          "functions": [
            {
              "function": "minecraft:set_count",
              "count": {
                "min": 2.0,
                "max": 4.0,
                "type": "minecraft:uniform"
              }
            }
          ]
        }
      ]
    },
    {
      "rolls": 3,
      "entries": [
        {
          "name": "minecraft:rail",
          "type": "minecraft:item",
          "weight": 20,
          "functions": [
            {
              "function": "minecraft:set_count",
              "count": {
                "min": 4.0,
                "max": 8.0,
                "type": "minecraft:uniform"
              }
            }
          ]
        },
        {
          "name": "minecraft:powered_rail",
          "type": "minecraft:item",
          "weight": 5,
          "functions": [
            {
              "function": "minecraft:set_count",
              "count": {
                "min": 1.0,
                "max": 4.0,
                "type": "minecraft:uniform"
              }
            }
          ]
        },
        {
          "name": "minecraft:detector_rail",
          "type": "minecraft:item",
          "weight": 5,
          "functions": [
            {
              "function": "minecraft:set_count",
              "count": {
                "min": 1.0,
                "max": 4.0,
                "type": "minecraft:uniform"
              }
            }
          ]
        },
        {
          "name": "minecraft:activator_rail",
          "type": "minecraft:item",
          "weight": 5,
          "functions": [
            {
              "function": "minecraft:set_count",
              "count": {
                "min": 1.0,
                "max": 4.0,
                "type": "minecraft:uniform"
              }
            }
          ]
        },
        {
          "name": "minecraft:torch",
          "type": "minecraft:item",
          "weight": 15,
          "functions": [
            {
              "function": "minecraft:set_count",
              "count": {
                "min": 1.0,
                "max": 16.0,
                "type": "minecraft:uniform"
              }
            }
          ]
        }
      ]
    },
    {
      "rolls": 1,
      "entries": [
        {
          "type": "minecraft:loot_table",
          "name": "repurposed_structures:chests/lucky_pool"
        }
      ]
    },
    {
      "rolls": 0,
      "bonus_rolls": 1,
      "entries": [
        {
          "type": "minecraft:empty",
          "weight": 130
        },
        {
          "name": "minecraft:black_banner",
          "type": "minecraft:item",
          "weight": 30,
          "functions": [
            {
              "function":"set_nbt",
              "tag":"{BlockEntityTag:{Patterns:[{Pattern:gra,Color:14},{Pattern:gra,Color:14},{Pattern:gru,Color:14},{Pattern:gru,Color:13},{Pattern:gru,Color:12},{Pattern:sku,Color:0},{Pattern:sku,Color:15},{Pattern:sku,Color:12},{Pattern:cbo,Color:15},{Pattern:bo,Color:15},{Pattern:drs,Color:12},{Pattern:ss,Color:15}]}}"
            }
          ]
        },
        {
          "name": "minecraft:tnt",
          "type": "minecraft:item",
          "weight": 10,
          "functions": [
            {
              "function": "minecraft:set_count",
              "count": 2
            }
          ]
        }
      ]
    }
  ]
}