Jump to content

Recommended Posts

Posted

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

 

 

Posted

And your debugging messages..?

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.

Posted

 

 

[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]: []

Posted

list = loottable.generateLootForPools(world.rand, context.build());

 

That is returning a zero-sized list.

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.

Posted

You're going to have to examine that method.

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.

Posted
5 minutes ago, theishiopian said:

I assume you mean generateLootForPools? 

There are no other methods on that line, so yes.

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.

Posted

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.

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.

Posted

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. 

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.