I was wondering about this: Is it possible to add multiple conditions to a function in Minecraft loot tables?
1 Answer
Yes. Here's an example loot table in which a stone sword's damage will only be set to 75% if the mob is killed by a player and a 50% random chance succeeds, otherwise it will drop an undamaged stone sword:
{
"pools": [
{
"rolls": 1,
"entries": [
{
"type": "item",
"weight": 1,
"name": "minecraft:stone_sword",
"functions": [
{
"function": "set_damage",
"damage": 0.75,
"conditions": [
{
"condition": "killed_by_player"
},
{
"condition": "random_chance",
"chance": 0.5
}
]
}
]
}
]
}
]
}
Here's a loot table generator capable of adding multiple conditions:
https://jsfiddle.net/MrPingouin/125mx5r5/embedded/result/
-
Thanks. I got it. I was trying other tool and i wasn't able to add more than 1 condition for a function. Commented Sep 13, 2016 at 11:08
-
One question - in this case all conditions must be true to do the function ? Commented Sep 13, 2016 at 11:11
-
1