Quplet / Qu-Enchantments

Me just adding whatever enchantments I think is cool that fit with vanilla Minecraft.
Apache License 2.0
2 stars 7 forks source link

[Feature Request] Add ability to enable/disable enchantments from appearing in enchantment tables, treasure, villagers, mob equipment and loot #6

Closed elhertz closed 1 year ago

elhertz commented 2 years ago

Hey! I've requested some of this features to a couple of devs before. I think it should greatly improve the experience with the mod.

So, in my use case, I like to make some of the new enchantments as treasure-only or as a custom boss' loot to make them rare, some can be crafted with NbtCrafting, others can be traded with villagers, then the rest that I consider not that broken/OP can still be obtained in the enchantment table.

Now, this request is super specific and it would only benefit me (a server owner/modpack maker) because I don't think casual players would make use of it. Still, I think it's a really good tool for us (server owners/modpack makers) to give our players a better experience with enchanting.

Specific info about my request:

Note: what's that about "enable-only"? With that setting you wouldn't need to go and disable enchantments one by one when for example you only need it as "treasure only".

Here are some old requests I made to other enchantment mods, the code might be useful to you: https://github.com/StrikerRockers-Mods/VanillaTweaksFabric/issues/6 https://github.com/Tigereye504/spellbound/issues/12 https://github.com/herb-mc/extra_enchants/issues/12

This it a lot of work so I wouldn't mind if you just want to keep your mod as simple as possible. Feel free to ask me more questions. Sometimes my english makes no sense. Thanks!

edit: fixed some typos

Quplet commented 2 years ago

The first I don't believe is possible. The rest I believe I can allow configuration using tags. However there are limits. Due to how MC handles enchantments, mob equipment and enchantment table selection are derived from the same method: isAvailableForRandomSelection(). So if you wish to allow it to appear on an enchanting table, but not on mobs, that will be impossible or at least very difficult to implement.

elhertz commented 2 years ago

The first I don't believe is possible.

If it's not possible then there's no problem.

Due to how MC handles enchantments, mob equipment and enchantment table selection are derived from the same method: isAvailableForRandomSelection(). So if you wish to allow it to appear on an enchanting table, but not on mobs, that will be impossible or at least very difficult to implement.

I understand. I don't know nothing about java and I don't know how you coded your mod but they managed to fix it and their code might be useful to you, I wouldn't know. Thanks for taking my request into consideration!