athy Posted November 30, 2019 Share Posted November 30, 2019 (edited) 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.json2) 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? Edited November 30, 2019 by athy Quote Link to comment Share on other sites More sharing options...
Xander402 Posted November 30, 2019 Share Posted November 30, 2019 (edited) Put your custom loot table in data.minecraft.loot_tables.blocks. Yes, you need to create the minecraft folder in your src/main/resources/data directory. It should get overridden proving the file is named the same as the vanilla loot table. Edited November 30, 2019 by Xander402 Quote A few bytes about me: public class Xander402 extends Modder implements IForumMember { int javaExperience, moddingExperience; LearningWay preferredLearningWay; public Xander402() { this.javaExperience = BIG; this.moddingExperience = NOT_SO_BIG; this.preferredLearningWay = LearningWay.through("exampes"); super(/*displayName*/"Xander402", /*moddingSince*/"1.9", preferredLearningWay); } @Override public Goal getReasonOfJoining(Forum forum) { return new Goal(() -> { while (true) moddingExperience++; }); } } Link to comment Share on other sites More sharing options...
athy Posted December 1, 2019 Author Share Posted December 1, 2019 5 hours ago, Xander402 said: Put your custom loot table in data.minecraft.loot_tables.blocks. Yes, you need to create the minecraft folder in your src/main/resources/data directory. It should get overridden proving the file is named the same as the vanilla loot table. I already have. It doesn't work. Read point 4 please Quote Link to comment Share on other sites More sharing options...
Xander402 Posted December 1, 2019 Share Posted December 1, 2019 (edited) 10 hours ago, athy said: I added custom crops and seeds to my mod, now I need those seeds to drop from the in-world grass. How about just adding a new loot table with pools only with your mod seeds items instead of overriding the entire grass loot table? Overriding would block others potential opportunity to make their own seeds that drop from vanilla grass. Edited December 1, 2019 by Xander402 Quote A few bytes about me: public class Xander402 extends Modder implements IForumMember { int javaExperience, moddingExperience; LearningWay preferredLearningWay; public Xander402() { this.javaExperience = BIG; this.moddingExperience = NOT_SO_BIG; this.preferredLearningWay = LearningWay.through("exampes"); super(/*displayName*/"Xander402", /*moddingSince*/"1.9", preferredLearningWay); } @Override public Goal getReasonOfJoining(Forum forum) { return new Goal(() -> { while (true) moddingExperience++; }); } } Link to comment Share on other sites More sharing options...
athy Posted December 1, 2019 Author Share Posted December 1, 2019 12 hours ago, Xander402 said: How about just adding a new loot table with pools only with your mod seeds items instead of overriding the entire grass loot table? Overriding would block others potential opportunity to make their own seeds that drop from vanilla grass. How would I go about doing that? Quote Link to comment Share on other sites More sharing options...
Xander402 Posted December 1, 2019 Share Posted December 1, 2019 Quote A few bytes about me: public class Xander402 extends Modder implements IForumMember { int javaExperience, moddingExperience; LearningWay preferredLearningWay; public Xander402() { this.javaExperience = BIG; this.moddingExperience = NOT_SO_BIG; this.preferredLearningWay = LearningWay.through("exampes"); super(/*displayName*/"Xander402", /*moddingSince*/"1.9", preferredLearningWay); } @Override public Goal getReasonOfJoining(Forum forum) { return new Goal(() -> { while (true) moddingExperience++; }); } } Link to comment Share on other sites More sharing options...
Recommended Posts
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.