Topic category: Help with Minecraft modding (Java Edition)
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.
you could also just add an Item and just place it in an anvil and apply the enchantment there maybe
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.