How can I have an entity loot table that is determined by location?
I've been trying to customize zombie drops depending on which biome it dies. For example, if the zombie dies in plain biome, it drops slime ball. If it dies in river, it drops leather (I choose these items just to test it out). I'm not sure if I'm writing the loot table wrong or minecraft just doesn't support this yet. Here's my loot table:
{
"type": "minecraft:entity",
"pools": [
{
"rolls": 1,
"entries": [
{
"type": "minecraft:item",
"name": "minecratf:slime_ball",
"weight": 1,
"functions": [
{
"function": "minecraft:set_count",
"count": {
"min": 1.0,
"max": 2.0,
"type": "minecraft:uniform"
}
}
],
"conditions": [
{
"condition": "minecraft:location_check",
"predicate": {
"biome": "minecraft:plains"
}
}
]
},
{
"type": "minecraft:item",
"name": "minecraft:leather",
"weight": 1,
"functions": [
{
"function": "minecraft:set_count",
"count": {
"min": 1.0,
"max": 2.0,
"type": "minecraft:uniform"
}
}
],
"conditions": [
{
"condition": "minecraft:location_check",
"predicate": {
"biome": "minecraft:river"
}
}
]
}
]
}
]
}
Solution 1:
Apparently the only issue is that you wrote "minecratf:slime_ball
" instead of "minecraft:slime_ball
". I fixed that typo, tried it and the loot table works.
"Ael" in the Minecraft commands Discord group also suggested this tool, which finds that issue: https://sourceblock.net/beta/tools/data-packs/loot-table-evaluator