Replacing vanilla enchantments

Started by v10r on

Topic category: Help with modding (Java Edition)

Last seen on 23:39, 5. Mar 2022
Joined Mar 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Replacing vanilla enchantments
Sat, 03/05/2022 - 05:26 (edited)

So, I decided to work on a balancing mod for 1.17. I have little to no knowledge in coding and considered this to be a fairly simple project to get started. However, It seems I have hit a roadblock. I want to change the function of the protection enchantment from the base game. The way I decided to go about it was to make a procedure for the game to replace the protection enchantment with a modded enchantment when the item gets it from an enchanting table. Unfortunately I don't seem to be able to change the inventory of the enchantment GUI, This problem is made even harder due to the fact that there is no such thing as an "on item enchanted" trigger.

Would it be possible to simply remove protection from the enchantment pool? Or remove It's damage reduction using a procedure so i may replace it with the desired effect? Failing all else, how do I go about replacing the enchantment with the modded one?

Edited by v10r on Sat, 03/05/2022 - 05:26
Last seen on 16:28, 17. May 2024
Joined Sep 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Well, without code you can…
Sat, 03/05/2022 - 08:10

Well, without code you can try replace the enchanting table with something similar that give different enchantments or replace the table recipe

Last seen on 23:39, 5. Mar 2022
Joined Mar 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I think I've figured out a…
Sat, 03/05/2022 - 09:11

I think I've figured out a solution. If I can get the game to constantly check for for armor pieces in the players inventory with protection then it can replace that enchantment with an enchantment of my own that looks identical (internal name is something else). I made a procedure for it. However, due to my limited knowledge it does not work.

Last seen on 23:39, 5. Mar 2022
Joined Mar 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
(No subject)
Sat, 03/05/2022 - 09:13

this is it