Topic category: Help with Minecraft modding (Java Edition)
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?
Well, without code you can try replace the enchanting table with something similar that give different enchantments or replace the table recipe
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.