Jump to content

(1.18.2) Gravel loot table ... how to modify?


badkraft

Recommended Posts

Here's the default loot table for gravel block:

{
  "type": "minecraft:block",
  "pools": [
    {
      "rolls": 1.0,
      "bonus_rolls": 0.0,
      "entries": [
        {
          "type": "minecraft:alternatives",
          "children": [
            {
              "type": "minecraft:item",
              "conditions": [
                {
                  "condition": "minecraft:match_tool",
                  "predicate": {
                    "enchantments": [
                      {
                        "enchantment": "minecraft:silk_touch",
                        "levels": {
                          "min": 1
                        }
                      }
                    ]
                  }
                }
              ],
              "name": "minecraft:gravel"
            },
            {
              "type": "minecraft:alternatives",
              "conditions": [
                {
                  "condition": "minecraft:survives_explosion"
                }
              ],
              "children": [
                {
                  "type": "minecraft:item",
                  "conditions": [
                    {
                      "condition": "minecraft:table_bonus",
                      "enchantment": "minecraft:fortune",
                      "chances": [
                        0.1,
                        0.14285715,
                        0.25,
                        1.0
                      ]
                    }
                  ],
                  "name": "minecraft:flint"
                },
                {
                  "type": "minecraft:item",
                  "name": "minecraft:gravel"
                }
              ]
            }
          ]
        }
      ]
    }
  ]
}

This is a finicky loot table. If I add anything to it, nothing drops. I've added pools, entries, children ... you name it.

Does anyone know the particulars about this table? I mean, periodically gravel drops flint instead of a gravel block. I understand the condition that could drop flint if the block survives an explosion. Otherwise, it drops the gravel block itself. I would like to further understand why the use of `children` and the set of `chance` values given in the explosion child entry.

What I do understand is that `"type" : "minecraft:alternatives"` means that if this child/entry is successful, then it stops generating loot for this entry/pool.

How often does the flint drop and is that taken care of in another location? Is that in a `"condition" : "minecraft:table_bonus"` loot table? Hmmm... I'll have to go take a look and see if there is something called table_bonus.json.

Link to comment
Share on other sites

The information you're looking for is found here, on Loot Tables:

https://minecraft.fandom.com/wiki/Loot_table

And here, on Predicates:

https://minecraft.fandom.com/wiki/Predicate

So specifically, in this case, the Table Bonus is the probability parameters being set for the drops in regards to the Fortune enchantment.

Survives explosion sets the probability of getting the block when an explosion occurs within the built in radius. If this isn't set, it's always successful.

Not sure what else you need to know, but I'm sure you can find it on those two pages and whatever other links on them.

Edited by Warren Tode
  • Like 1
Link to comment
Share on other sites

I read both of those and with the help of an online loot table generator, I was able to see how it is constructed. I ended up successfully modifying the gravel loot table. Thanks...

{
    "type": "minecraft:block",
    "pools": [
        {
            "rolls": 1,
            "bonus_rolls": 0,
            "entries": [
                {
                    "type": "minecraft:alternatives",
                    "children": [
                        {
                            "type": "minecraft:item",
                            "name": "minecraft:gravel",
                            "conditions": [
                                {
                                    "condition": "minecraft:match_tool",
                                    "predicate": {
                                        "enchantments": [
                                            {
                                                "enchantment": "minecraft:silk_touch",
                                                "levels": {
                                                    "min": 1
                                                }
                                            }
                                        ]
                                    }
                                }
                            ]
                        },
                        {
                            "type": "minecraft:item",
                            "name": "minecraft:flint",
                            "conditions": [
                                {
                                    "condition": "minecraft:random_chance",
                                    "chance": 0.45
                                }
                            ]
                        },
                        {
                            "type": "minecraft:item",
                            "name": "minecraft:coal",
                            "conditions": [
                                {
                                    "condition": "minecraft:random_chance",
                                    "chance": 0.20
                                }
                            ]
                        },
                        {
                            "type": "minecraft:item",
                            "name": "foundations:iron_nugget_ore",
                            "conditions": [
                                {
                                    "condition": "minecraft:random_chance",
                                    "chance": 0.057
                                }
                            ]
                        },
                        {
                            "type": "minecraft:item",
                            "name": "foundations:clay_ore",
                            "conditions": [
                                {
                                    "condition": "minecraft:random_chance",
                                    "chance": 0.038
                                }
                            ]
                        },
                        {
                            "type": "minecraft:item",
                            "name": "minecraft:raw_iron",
                            "conditions": [
                                {
                                    "condition": "minecraft:random_chance",
                                    "chance": 0.0075
                                }
                            ]
                        },
                        {
                            "type": "minecraft:item",
                            "name": "foundations:gold_nugget_ore",
                            "conditions": [
                                {
                                    "condition": "minecraft:random_chance",
                                    "chance": 0.0025
                                }
                            ]
                        },
                        {
                            "type": "minecraft:alternatives",
                            "conditions": [
                                {
                                    "condition": "minecraft:survives_explosion"
                                }
                            ],
                            "children": [
                                {
                                    "type": "minecraft:item",
                                    "name": "minecraft:flint",
                                    "conditions": [
                                        {
                                            "condition": "minecraft:table_bonus",
                                            "enchantment": "minecraft:fortune",
                                            "chances": [
                                                0.1,
                                                0.142387,
                                                0.25,
                                                1.0
                                            ]
                                        }
                                    ]
                                },
                                {
                                    "type": "minecraft:item",
                                    "name": "minecraft:gravel"
                                }
                            ]
                        }
                    ]
                }
            ]
        }
    ]
}
{
    "type": "minecraft:block",
    "pools": [
        {
            "rolls": 1,
            "bonus_rolls": 0,
            "entries": [
                {
                    "type": "minecraft:alternatives",
                    "children": [
                        {
                            "type": "minecraft:item",
                            "name": "minecraft:gravel",
                            "conditions": [
                                {
                                    "condition": "minecraft:match_tool",
                                    "predicate": {
                                        "enchantments": [
                                            {
                                                "enchantment": "minecraft:silk_touch",
                                                "levels": {
                                                    "min": 1
                                                }
                                            }
                                        ]
                                    }
                                }
                            ]
                        },
                        {
                            "type": "minecraft:item",
                            "name": "minecraft:flint",
                            "conditions": [
                                {
                                    "condition": "minecraft:random_chance",
                                    "chance": 0.45
                                }
                            ]
                        },
                        {
                            "type": "minecraft:item",
                            "name": "minecraft:coal",
                            "conditions": [
                                {
                                    "condition": "minecraft:random_chance",
                                    "chance": 0.20
                                }
                            ]
                        },
                        {
                            "type": "minecraft:item",
                            "name": "foundations:iron_nugget_ore",
                            "conditions": [
                                {
                                    "condition": "minecraft:random_chance",
                                    "chance": 0.057
                                }
                            ]
                        },
                        {
                            "type": "minecraft:item",
                            "name": "foundations:clay_ore",
                            "conditions": [
                                {
                                    "condition": "minecraft:random_chance",
                                    "chance": 0.038
                                }
                            ]
                        },
                        {
                            "type": "minecraft:item",
                            "name": "minecraft:raw_iron",
                            "conditions": [
                                {
                                    "condition": "minecraft:random_chance",
                                    "chance": 0.0075
                                }
                            ]
                        },
                        {
                            "type": "minecraft:item",
                            "name": "foundations:gold_nugget_ore",
                            "conditions": [
                                {
                                    "condition": "minecraft:random_chance",
                                    "chance": 0.0025
                                }
                            ]
                        },
                        {
                            "type": "minecraft:alternatives",
                            "conditions": [
                                {
                                    "condition": "minecraft:survives_explosion"
                                }
                            ],
                            "children": [
                                {
                                    "type": "minecraft:item",
                                    "name": "minecraft:flint",
                                    "conditions": [
                                        {
                                            "condition": "minecraft:table_bonus",
                                            "enchantment": "minecraft:fortune",
                                            "chances": [
                                                0.1,
                                                0.142387,
                                                0.25,
                                                1.0
                                            ]
                                        }
                                    ]
                                },
                                {
                                    "type": "minecraft:item",
                                    "name": "minecraft:gravel"
                                }
                            ]
                        }
                    ]
                }
            ]
        }
    ]
}

I treat gravel as a filter catch-all. Some extra minor drops - adding some nugget ores so you don't get iron ores dropping from gravel except on rare occurrence. Clay ore is a new item I've implemented that drops from a new clay block added to regular clay generation.

 

...edited the loot table. It was an older one while I was building it. This one is the complete loot table.

Edited by badkraft
  • Like 1
Link to comment
Share on other sites

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...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

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