Loottable with enchanted book

Started by Shiryou on

Topic category: Help with Minecraft modding (Java Edition)

Joined May 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Loottable with enchanted book

Hi,

basically, I made a custom enchantment and I want it to only be found in stronghold chests, preferably only stronghold_library chests, also including the vanilla loot.

I've read you can't add items to the vanilla loottables, so I've made my own loottable which just has all items from the vanilla loottable. I can get it to only spawn in the library and no where else, I can add custom items in there and that's all fine. 

But here's my problem: the enchanted book (which is also in the vanilla loottable) which I've added to the loottable has no enchantments on it and I haven't been able to find a way to get it to have any enchantments using a custom loottable. 

I can make it a non-treasure enchant, so I wouldn't need a custom loottable for it to spawn in there, but that also means you'll be able to get the enchantment from using an enchantment table, which is something I do not want.

I've seen some talk about changing certain parts of the code or something.. but I haven't actually been able to find anything that works/is helpful.

 So please, let me know if you know anything.

 

Joined Mar 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
you could also just add an…
Tue, 05/31/2022 - 15:28

you could also just add an Item and just place it in an anvil and apply the enchantment there maybe

Joined Feb 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I suggest looking at and…
Tue, 05/31/2022 - 20:40

I suggest looking at and copying the code from one of the enchantments from minecraft that does the same thing and editing it. This would require actual java coding though, however you could just copy it and replace it with your effect, and remove its own effect.