Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

To be clear, i have added loot_tables before, and i have also added loot_tables in this mod i'm making right now. However, some loot_table jsons aren't working and i can't get my head around why they don't. So here is one of them that i think should work but doesn't. 

Quote

{
    "pools": [
        {
            "name": "main",
            "rolls": {
                "min": 1,
                "max": 3
            },
            "entries": [
                {
                    "type": "item",
                    "weight": 15,
                    "name": "minecraft:bone",
                    "functions": [
                        {
                            "function": "set_count",
                            "count": {
                                "min": 1,
                                "max": 6
                            }
                        }
                    ]
                },
                {
                    "type": "item",
                    "weight": 15,
                    "name": "minecraft:rotten_flash",
                    "functions": [
                        {
                            "function": "set_count",
                            "count": {
                                "min": 1,
                                "max": 6
                            }
                        }
                    ]
                },
                {
                    "type": "item",
                    "weight": 10,
                    "name": "minecraft:iron_ingot",
                    "functions": [
                        {
                            "function": "set_count",
                            "count": {
                                "min": 1,
                                "max": 3
                            }
                        }
                    ]
                },
                {
                    "type": "item",
                    "weight": 5,
                    "name": "minecraft:diamond",
                    "functions": [
                        {
                            "function": "set_count",
                            "count": {
                                "min": 1,
                                "max": 2
                            }
                        }
                    ]
                },
                {
                    "type": "item",
                    "weight": 5,
                    "name": "minecraft:dye",
                    "functions": [
                        {
                            "function": "set_data",
                            "data": 4
                        },
                        {
                            "function": "set_count",
                            "count": {
                                "min": 1,
                                "max": 7
                            }
                        }
                    ]
                },
                {
                    "type": "item",
                    "weight": 10,
                    "name": "minecraft:string",
                    "functions": [
                        {
                            "function": "set_count",
                            "count": {
                                "min": 1,
                                "max": 5
                            }
                        }
                    ]
                },
                {
                    "type": "item",
                    "weight": 5,
                    "name": "minecraft:arrow",
                    "functions": [
                        {
                            "function": "set_count",
                            "count": {
                                "min": 1,
                                "max": 8
                            }
                        }
                    ]
                }
            ]
        },
        {
            "rolls": {
                "min": 1,
                "max": 3
            },
            "entries": [
                {
                    "type": "item",
                    "weight": 2,
                    "name": "minecraft:stone_sword"
                },
                {
                    "type": "item",
                    "weight": 5,
                    "name": "minecraft:wooden_sword"
                },
                {
                    "type": "item",
                    "weight": 1,
                    "name": "minecraft:wheat",
                    "functions": [
                        {
                            "function": "set_count",
                            "count": {
                                "min": 1,
                                "max": 5
                            }
                        }
                    ]
                },
                {
                    "type": "item",
                    "weight": 2,
                    "name": "minecraft:book",
                    "functions": [
                        {
                            "function": "enchant_randomly"
                        }
                    ]
                },
                {
                    "type": "item",
                    "weight": 2,
                    "name": "minecraft:book",
                    "functions": [
                        {
                            "function": "enchant_randomly"
                        }
                    ]
                },
                {
                    "type": "item",
                    "weight": 5,
                    "name": "minecraft:leather_helmet"
                },
                {
                    "type": "item",
                    "weight": 5,
                    "name": "minecraft:leather_chestplate"
                },
                {
                    "type": "item",
                    "weight": 5,
                    "name": "minecraft:leather_leggings"
                },
                {
                    "type": "item",
                    "weight": 5,
                    "name": "minecraft:leather_boots"
                }
            ]
        },
        {
            "rolls": {
                "min": 1,
                "max": 3
            },
            "entries": [
                {
                    "type": "item",
                    "weight": 10,
                    "name": "minecraft:stick",
                    "functions": [
                        {
                            "function": "set_count",
                            "count": {
                                "min": 1,
                                "max": 3
                            }
                        }
                    ]
                },
                {
                    "type": "item",
                    "weight": 10,
                    "name": "minecraft:leather",
                    "functions": [
                        {
                            "function": "set_count",
                            "count": {
                                "min": 1,
                                "max": 3
                            }
                        }
                    ]
                },
                {
                    "type": "item",
                    "weight": 15,
                    "name": "minecraft:glass_bottle",
                    "functions": [
                        {
                            "function": "set_count",
                            "count": {
                                "min": 1,
                                "max": 5
                            }
                        }
                    ]
                },
                {
                    "type": "item",
                    "weight": 1,
                    "name": "minecraft:experience_bottle",
                    "functions": [
                        {
                            "function": "set_count",
                            "count": {
                                "min": 1,
                                "max": 5
                            }
                        }
                    ]
                },
                {
                    "type": "item",
                    "weight": 1,
                    "name": "minecraft:shield"
                },
                {
                    "type": "item",
                    "weight": 5,
                    "name": "etauric:yarch_ingot",
                    "functions": [
                        {
                            "function": "set_count",
                            "count": {
                                "min": 1,
                                "max": 3
                            }
                        }
                    ]
                },
                {
                    "type": "item",
                    "weight": 10,
                    "name": "minecraft:gunpowder",
                    "functions": [
                        {
                            "function": "set_count",
                            "count": {
                                "min": 1,
                                "max": 3
                            }
                        }
                    ]
                }
            ]
        },
        {
            "rolls": {
                "min": 1,
                "max": 3
            },
            "entries": [
                {
                    "type": "item",
                    "weight": 10,
                    "name": "minecraft:bread",
                    "functions": [
                        {
                            "function": "set_count",
                            "count": {
                                "min": 1,
                                "max": 2
                            }
                        }
                    ]
                },
                {
                    "type": "item",
                    "weight": 10,
                    "name": "minecraft:feather",
                    "functions": [
                        {
                            "function": "set_count",
                            "count": {
                                "min": 1,
                                "max": 3
                            }
                        }
                    ]
                },
                {
                    "type": "item",
                    "weight": 5,
                    "name": "minecraft:book",
                    "functions": [
                        {
                            "function": "set_count",
                            "count": {
                                "min": 1,
                                "max": 2
                            }
                        }
                    ]
                },
                {
                    "type": "item",
                    "weight": 2,
                    "name": "minecraft:iron_horse_armor"
                },
                {
                    "type": "item",
                    "weight": 20,
                    "name": "minecraft:cobblestone",
                    "functions": [
                        {
                            "function": "set_count",
                            "count": {
                                "min": 1,
                                "max": 9
                            }
                        }
                    ]
                }
            ]
        }
    ]
}

There aren't any problems with the registering of the loot_table either, i have tried with the same name with different loot inside and it works, but this loot does not. 

  • Author

After looking into it for a day, i found out that you can never have two of the same item in the same pool, even if the other one is enchanted. So i made some alternative pools to overcome this and now everything works. 

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.