2
\$\begingroup\$

I cannot figure out how to override vanilla loot tables, I've been at this for hours, and I can't find anything online. Just very outdated tutorials. I added custom crops and seeds to my mod, now I need those seeds to drop from the in-world grass.

The loot tables for my custom blocks are in data.modId.loot_tables.blocks and they work just fine.

Now, when I try to override the grass to drop an item of my choosing, say, coal, I do this:

1) Make grass.json

2) Fill it:

{
  "type": "minecraft:block",
  "pools": [
    {
      "rolls": 1,
      "entries": [
        {
          "type": "minecraft:alternatives",
          "children": [
            {
              "type": "minecraft:item",
              "conditions": [
                {
                  "condition": "minecraft:match_tool",
                  "predicate": {
                    "item": "minecraft:shears"
                  }
                }
              ],
              "name": "minecraft:grass"
            },
            {
              "type": "minecraft:item",
              "conditions": [
                {
                  "condition": "minecraft:random_chance",
                  "chance": 0.125
                }
              ],
              "functions": [
                {
                  "function": "minecraft:apply_bonus",
                  "enchantment": "minecraft:fortune",
                  "formula": "minecraft:uniform_bonus_count",
                  "parameters": {
                    "bonusMultiplier": 2
                  }
                },
                {
                  "function": "minecraft:explosion_decay"
                }
              ],
              "name": "minecraft:coal"
            }
          ]
        }
      ]
    }
  ]
}

3) Place it in my project in data.minecraft.loot_tables.blocks

When I test it in game, grass still drops wheat seeds and not coal. Why?

\$\endgroup\$
1
  • \$\begingroup\$ It is unclear why this is happening. However, if your intent is to eventually get grass to drop custom seeds, I suggest this method instead. \$\endgroup\$ Dec 30, 2019 at 2:36

0

You must log in to answer this question.

Browse other questions tagged .