I am trying to create a custom chest loot table and no matter what I try, it is not working. I have been researching this issue for 3 days now, and have had no success.
My pack is in this filepath:
...\datapacks\BattlePack\data\battle\loot_tables\chests\battle_gear.json
This is my pack.mcmeta
:
{
"pack": {
"pack_format": 10,
"description": "Battle Pack"
}
}
This is my battle_gear.json
:
{
"type": "minecraft:chests",
"pools": [
{
"rolls": {
"min": 5,
"max": 10
},
"entries": [
{
"type": "minecraft:item",
"name": "minecraft:wooden_sword",
"weight": 100
},
{
"type": "minecraft:item",
"name": "minecraft:stone_sword",
"weight": 75
},
{
"type": "minecraft:item",
"name": "minecraft:golden_sword",
"weight": 50
},
{
"type": "minecraft:item",
"name": "minecraft:iron_sword",
"weight": 60
},
{
"type": "minecraft:item",
"name": "minecraft:wooden_axe",
"weight": 75
},
{
"type": "minecraft:item",
"name": "minecraft:stone_axe",
"weight": 50
},
{
"type": "minecraft:item",
"name": "minecraft:iron_axe",
"weight": 20
},
{
"type": "minecraft:item",
"name": "minecraft:diamond_sword",
"weight": 100
},
{
"type": "minecraft:item",
"name": "minecraft:bread",
"weight": 100,
"functions": [
{
"function": "minecraft:set_count",
"count": {
"min": 5,
"max": 8
}
}
]
},
{
"type": "minecraft:item",
"name": "minecraft:porkchop",
"weight": 60,
"functions": [
{
"function": "minecraft:set_count",
"count": {
"min": 1,
"max": 5
}
}
]
},
{
"type": "minecraft:item",
"name": "minecraft:beef",
"weight": 55,
"functions": [
{
"function": "minecraft:set_count",
"count": {
"min": 1,
"max": 6
}
}
]
},
{
"type": "minecraft:item",
"name": "minecraft:cooked_beef",
"weight": 20,
"functions": [
{
"function": "minecraft:set_count",
"count": {
"min": 1,
"max": 4
}
}
]
},
{
"type": "minecraft:item",
"name": "minecraft:apple",
"weight": 99,
"functions": [
{
"function": "minecraft:set_count",
"count": {
"min": 5,
"max": 12
}
}
]
},
{
"type": "minecraft:item",
"name": "minecraft:golden_apple",
"weight": 5,
"functions": [
{
"function": "minecraft:set_count",
"count": {
"min": 1,
"max": 2
}
}
]
},
{
"type": "minecraft:item",
"name": "minecraft:netherite_ingot",
"weight": 6,
"functions": [
{
"function": "minecraft:set_count",
"count": {
"min": 1,
"max": 2
}
}
]
},
{
"type": "minecraft:item",
"name": "minecraft:dirt",
"weight": 99,
"functions": [
{
"function": "minecraft:set_data",
"data": 0
},
{
"function": "minecraft:set_count",
"count": {
"min": 15,
"max": 30
}
}
]
},
{
"type": "minecraft:item",
"name": "minecraft:chainmail_chestplate",
"weight": 30
},
{
"type": "minecraft:item",
"name": "minecraft:leather_chestplate",
"weight": 100
},
{
"type": "minecraft:item",
"name": "minecraft:iron_chestplate",
"weight": 20
},
{
"type": "minecraft:item",
"name": "minecraft:golden_chestplate",
"weight": 25
},
{
"type": "minecraft:item",
"name": "minecraft:diamond",
"weight": 15,
"functions": [
{
"function": "minecraft:set_count",
"count": {
"min": 0,
"max": 8
}
}
]
},
{
"type": "minecraft:item",
"name": "minecraft:leather_boots",
"weight": 85
},
{
"type": "minecraft:item",
"name": "minecraft:chainmail_boots",
"weight": 55
},
{
"type": "minecraft:item",
"name": "minecraft:golden_boots",
"weight": 65
},
{
"type": "minecraft:item",
"name": "minecraft:iron_boots",
"weight": 75
},
{
"type": "minecraft:item",
"name": "minecraft:iron_ingot",
"weight": 65,
"functions": [
{
"function": "minecraft:set_count",
"count": {
"min": 5,
"max": 20
}
}
]
},
{
"type": "minecraft:item",
"name": "minecraft:log",
"weight": 85,
"functions": [
{
"function": "minecraft:set_count",
"count": {
"min": 1,
"max": 18
}
}
]
},
{
"type": "minecraft:item",
"name": "minecraft:book",
"weight": 100,
"functions": [
{
"function": "minecraft:set_count",
"count": {
"min": 1,
"max": 10
}
}
]
}
]
}
]
}
I used minecraft.tools for this generation, but cross referenced misode's generator to make sure that everything was still formated and named correctly (I just chose minecraft.tools for the simplicity, and it has worked for me in the past)
I have tried nearly every possible command I could find in order to get this chest into my world, and yet none have worked. This is the command I am currently trying, given that it was the most recent working answer I have found:
/setblock ~ ~1 ~ minecraft:chest{BlockEntityTag:{LootTable:"battle:chests/battle_gear"}} replace
Source
Absolutely nothing is working, and I only ever get an empty chest. I have checked everything several times over, and have found no faults, so I am really not sure what is going wrong. I also know that my datapack is loaded correctly, as it is listed in the /datapack list
command and my load.mcfunction
script runs.