NBTEditor

NBTEditor

238k Downloads

Loot tables

SadSpider opened this issue · 1 comments

commented

Is there a way we can change the loot table for all the mobs of one type? Such as all ender dragons dropping a dragon egg etc? I want to do this but can’t find anywhere were it says how to.

Thanks

commented

You can do this without any plugins. Here's an example for doing this.

You'll need to create a new datapack (or modify an existing one). For example:

<world folder>/datapacks/<datapack_name>/data/minecraft/loot_tables/entities/creeper.json

{
    "pools": [
        {
            "rolls": 1,
            "entries": [
                {
                    "type": "item",
                    "name": "minecraft:gunpowder",
                    "weight": 2,
                    "functions": [
                        {
                            "function": "set_count",
                            "count": {
                                "min": 1,
                                "max": 2
                            }
                        }
                    ]
                },
                {
                    "type": "item",
                    "name": "minecraft:carrot",
                    "weight": 1,
                    "functions": [
                        {
                            "function": "set_count",
                            "count": {
                                "min": 2,
                                "max": 4
                            }
                        }
                    ]
                }
            ]
        }
    ]
}

This makes creepers drop gunpowder... or carrots. Yum