Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Loot tables #36

Open
SadSpider opened this issue Apr 6, 2019 · 1 comment
Open

Loot tables #36

SadSpider opened this issue Apr 6, 2019 · 1 comment

Comments

@SadSpider
Copy link

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

@Combustible
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants