Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
elhertz opened this issue Jul 24, 2022 · 2 comments

Comments

@elhertz
Copy link

elhertz commented Jul 24, 2022

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:

  • General: ability to disable enchantments from initializing (I don't know if that's possible but it would be a good way to prevent enchantments even from appearing in mods like REI)
  • Enchantment table: ability to enable-only/disable certain enchantments from appearing in the enchantment table.
  • Treasure: ability to enable-only/disable certain enchantments from appearing in treasure loot tables.
    There's this function that minecraft uses to assign a random enchantment to an enchanted book, armor, weapon, or tool. It includes all the enchantments afaik. It's called "minecraft:enchant_randomly". I use lots of mods/datapacks that add new structures and mobs and it's a pain having to manually edit 500 loot tables everytime I add new enchantments.
  • Villager trading: ability to enable-only/disable certain enchantments from appearing in villager trades.
  • Mob equipment and mob loot: enable-only/disable certain enchantments from appearing in mob equipment and loot (I remember there was this mod that allowed you to disable enchantments but they would still appear in mob armor and weapons so I had to deal with the fact that you can't even disable them using loot tables)

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:
StrikerRockers-Mods/VanillaTweaksFabric#6
Tigereye504/spellbound#12
herb-mc/extra_enchants#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
Copy link
Owner

Quplet commented Jul 24, 2022

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
Copy link
Author

elhertz commented Jul 25, 2022

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!

@Quplet Quplet closed this as completed Dec 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants