Jump to content

Recommended Posts

Posted

Loot tables. I am creating a mod and I ran into a problem. I need wither skeleton to drop "negatite_mixture" (modded item) apart from usual coal, bones, swords.

So what should I better do? 

I know what vanilla loot table .json file looks like and what consists of. I also heard something about "events" and "LootTableLoadEvent"

 

((( I replaced "minecraft:bone" with "aragonagemod:negatite_mixture" but it didnt work at all! )))

I DO want to know the way I should do! Could you please help with examples or some 1.2.3.4.5. Instructions? PLS 

Posted

Option (1) completely override the loot table by creating your own and putting it in the same resource directory as the vanilla file (e.g src/resources/data/minecraft/loot_tables). This is a last-mod-wins solution.

Option (2) append the loot table using the LootTableLoadEvent. By appending you don't interfere with other mods, but also can't prevent existing drops (so you'd get bones AND your item instead of bone OR your item).

Option (3) use a Global Loot Modifier. This is by far the most flexible and powerful option.

  • Like 1

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
56 minutes ago, Draco18s said:

Option (1) completely override the loot table by creating your own and putting it in the same resource directory as the vanilla file (e.g src/resources/data/minecraft/loot_tables). This is a last-mod-wins solution.

Option (2) append the loot table using the LootTableLoadEvent. By appending you don't interfere with other mods, but also can't prevent existing drops (so you'd get bones AND your item instead of bone OR your item).

Option (3) use a Global Loot Modifier. This is by far the most flexible and powerful option.

I've examined a lot of explanations on events on the net but Unfortunately I don't clearly understand how to use events yet even though I preferred Option(2). I am beginner at java and all I want is: "wither skeleton drops 1-2(+1 with each level of looting) item_name  on death". Do you have the simplest example of code to look at?

Posted (edited)

Check any vanilla monster's loot table file, one where there's really basic loot (so not cows and pigs that deal with being on fire). Squid is a good example.

 

Take that file, change the item dropped, put it in your own resource directory, and then add it during the event (as my code shows you how to do).

Edited by Draco18s
  • Like 1

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.

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.