Posted November 30, 20195 yr 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, 20195 yr by athy
November 30, 20195 yr 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, 20195 yr by Xander402 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++; }); } }
December 1, 20195 yr Author 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
December 1, 20195 yr 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, 20195 yr by Xander402 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++; }); } }
December 1, 20195 yr Author 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?
December 1, 20195 yr 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++; }); } }
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.