0

I was wondering about this: Is it possible to add multiple conditions to a function in Minecraft loot tables?

1 Answer 1

2

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/

3
  • Thanks. I got it. I was trying other tool and i wasn't able to add more than 1 condition for a function. Sep 13, 2016 at 11:08
  • One question - in this case all conditions must be true to do the function ? Sep 13, 2016 at 11:11
  • 1
    @HarvantS. Yep, I believe so.
    – SirBenet
    Sep 13, 2016 at 11:15

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .