theishiopian Posted April 29, 2018 Posted April 29, 2018 I'm trying to make a system that allows you to define loot tables for blocks. To do this, I'm using the method shown in the forge docs, but it doesnt seem to work for me. The list that stores the resulting itemstacks never gets populated, and the block drops nothing. Here's the event handler I'm using: https://pastebin.com/1Q5JSC7H And heres the table, which is located at src/main/resources/assets/foragecraft/loot_tables/dirt.json: https://pastebin.com/tZQhZfHn Quote
Draco18s Posted April 29, 2018 Posted April 29, 2018 And your debugging messages..? Quote Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable. If you think this is the case, JUST REPORT ME. Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice. Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked. DO NOT PM ME WITH PROBLEMS. No help will be given.
theishiopian Posted April 29, 2018 Author Posted April 29, 2018 [19:30:41] [Server thread/INFO] [STDOUT]: [com.theishiopian.foragecraft.handler.BlockForageHandler:blockBreak:31]: net.minecraft.world.storage.loot.LootTable@58554c7e [19:30:41] [Server thread/INFO] [STDOUT]: [com.theishiopian.foragecraft.handler.BlockForageHandler:blockBreak:44]: [] Quote
Draco18s Posted April 29, 2018 Posted April 29, 2018 list = loottable.generateLootForPools(world.rand, context.build()); That is returning a zero-sized list. Quote Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable. If you think this is the case, JUST REPORT ME. Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice. Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked. DO NOT PM ME WITH PROBLEMS. No help will be given.
theishiopian Posted April 29, 2018 Author Posted April 29, 2018 Yes, I know that. What I want to know is why. Quote
Draco18s Posted April 29, 2018 Posted April 29, 2018 You're going to have to examine that method. Quote Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable. If you think this is the case, JUST REPORT ME. Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice. Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked. DO NOT PM ME WITH PROBLEMS. No help will be given.
theishiopian Posted April 29, 2018 Author Posted April 29, 2018 I assume you mean generateLootForPools? Quote
theishiopian Posted April 29, 2018 Author Posted April 29, 2018 I apologize if I'm missing something terribly obvious, I've never used loot tables before. Quote
Draco18s Posted April 29, 2018 Posted April 29, 2018 5 minutes ago, theishiopian said: I assume you mean generateLootForPools? There are no other methods on that line, so yes. Quote Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable. If you think this is the case, JUST REPORT ME. Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice. Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked. DO NOT PM ME WITH PROBLEMS. No help will be given.
theishiopian Posted April 29, 2018 Author Posted April 29, 2018 I've looked at that method before, and I can't see the problem. Since vanilla uses it all the time, I know it works. Quote
Draco18s Posted April 29, 2018 Posted April 29, 2018 So you need to follow the execution of the vanilla code when you pass it in your data and figure out why it is not returning what you expect. Quote Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable. If you think this is the case, JUST REPORT ME. Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice. Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked. DO NOT PM ME WITH PROBLEMS. No help will be given.
theishiopian Posted April 29, 2018 Author Posted April 29, 2018 I've followed this rabbit hole for days, I can't find anything. I've narrowed the problem down to the resource location, or possibly the loot context, but I can't find anything wrong with either, based on similar usages of the code in other projects. Quote
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.