Adding Items to Vanilla Mob Loot

Started by slave2midn on Mon, 05/09/2022 - 16:09

Topic category: Help with MCreator software

Last seen on 00:15, 6. Jun 2022
Joined May 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
Adding Items to Vanilla Mob Loot
Mon, 05/09/2022 - 16:09

Hey All!

This forum has been super helpful, and I thank everyone for contributing. I wanted to add a feature to my mod that allows certain mobs-namely Zombies & Skeletons to drop an Emerald as a chance drop. However, I don't want to modify or alter vanilla loot tables for the mobs in question.

I know I can make a loot table for a MC mod, and then add the emerald to the table list-but my question was does this OVERIDE the entire loot table of the mob? Or does it simply add to it?

Should I replicate the mobs loot table from MC wiki and then incorporate my item? Or is there a means of just adding an item to the mobs loot table and keeping its traditional loot drops?

Last seen on 00:37, 29. May 2022
Joined Mar 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
It just adds to it im pretty…
Sun, 05/29/2022 - 00:32

It just adds to it im pretty sure. Not entirely overriding

Last seen on 00:02, 25. Jun 2022
Joined Mar 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
It overrides. What you can…
Sun, 05/29/2022 - 14:55

It overrides.

What you can do is make a new loot table entry, you can leave it empty.  Open the vanilla Minecraft jar and find the loot table of the mob in question.  Open this file, select and copy all text. Go back to your new loot table and open it with the code editor.  Overwrite everything with the vanilla code.  Now, code in the edits you want to make then save and lock.

This keeps all the vanilla drop chances without needing to recreate them from scratch as well as any special code that Mcreator doesn't cover (like cooked meat dropping from burning cows).