Add an enchanted book to a loot table

Started by Batteries Not … on

Topic category: Help with modding (Java Edition)

Last seen on 00:02, 3. Oct 2021
Joined Jan 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Add an enchanted book to a loot table

Hello, I have implemented an enchantment that is meant to drop from a boss. How do I add the specific book to a loot table?

Last seen on 22:49, 17. Mar 2021
Joined Jan 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
You can't do this with the…
Thu, 08/13/2020 - 14:48

You can't do this with the MCreator software. However, it is quite easy to do by making your loot table, then changing the code (the ID would be enchanted_book{StoredEnchantments:[{id:*name_of_mod*:*name_of_enchantment*,lvl:1}]} (delete the *'s in there as well).

For example, with a custom curse from my mod, I would do enchanted_book{StoredEnchantments:[{id:brine:drowning_curse,lvl:1}]}

Last seen on 23:41, 29. Aug 2024
Joined Aug 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
i tried doing this but now…
Thu, 08/08/2024 - 21:27

i tried doing this but now the chests just have no items in them

Last seen on 07:35, 15. Sep 2024
Joined Feb 2018
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Is the Boss from your Mod?…
Thu, 08/08/2024 - 21:35

Is the Boss from your Mod? If not then you need to use this Plugin: Loot modifier.

This allows you to add your Loot Table into existing ones without replacing it. 

Also which MC Version are you using?

But you use this Loot Table Generator for your Situation. There you need to add "Functions" to your Item and just copy the Functions Code.