Posted May 15, 20205 yr Working on my first mod, and I've followed a few examples to create items and blocks, but I can't for the life of me get my custom loot_table loaded. If I put a bad element in the json, I see an error in the debug.log, but if the file looks good, it simply doesn't load (nothing shows in the logs.) Stepping through the code, I see it get all the way to ForgeHooks.loadLootTable(), but since custom==true, it never calls the ForgeEventFactory.loadLootTable() method, so it never gets registered (I'm guessing here - while I've got years of Java experience, I only have days of minecraft mod experience.) I've gone over my code many times, and have made it as simple as I can to narrow down potential issues, but I'm stumped. Running on Forge 1.15.2-1.31.0, Java 1.8.0_161, and Eclipse 2020-03. I've attached my loot_table and model/block json files, along with the source code where I register everything - anyone have any ideas? Thanks in advance. -mike ruby_block.json ruby_block.json RegistryHandler.java
May 15, 20205 yr I remember that when you do your own loot tables you need to add name tag in front of the "rolls" { "type": "minecraft:block", "pools": [ { "name": "a name here", <----------- "rolls": 1, "entries": [ { "type": "minecraft:item", "name": "minecraft:apple" } ] } ] } if you want to have a try with that
May 15, 20205 yr Author Yeah, I had that in there before. Just tried again, still doesn't work. { "type": "minecraft:block", "pools": [ { "name": "tutorial_loot_table", "rolls": 1, "entries": [ { "type": "minecraft:item", "name": "minecraft:apple" } ] } ] }
May 15, 20205 yr Everything looks right to me, compared it to a block drop json I have that I know works, seems like everything's right, it looks in the right folder and everything. Just to throw this out there, you aren't in creative mode, are you? Things don't drop in creative mode
May 15, 20205 yr Author @Ugdhar you're a lifesaver! I was in creative mode. I'm writing this mod for my kids, and when I read them your comment, they said, "Yeah, obviously!" Obviously to them, who play all the time. I've given them additional chores today to make up for the hours of my life debugging code that was working fine that I'll never get back. Thank you SO much! -mike
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.