Removing Specifc Enchantments

Started by finnodile on

Topic category: Help with Minecraft modding (Java Edition)

Joined May 2025
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Removing Specifc Enchantments

I have a sandpaper item in my mod that I intend to use to remove curses from any item and NO other enchantments, like a reverse grindstone. How will I do this, with detailed instructions on procedures? 

 

If the solution requires adding a block or gui for the purpose of the item, thats okay! 

Joined Jul 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Well you would need to…
Fri, 03/27/2026 - 13:30

Well you would need to figure out how to apply the sandpaper to the item. After that you make a procedure which checks whether provided itemstack(being the item) has specific enchantment, if so remove specific enchantment. Then continue for all curse enchants.

The procedure really depends on the scenario, if you make a grindstone type block where the 'fuel' is sandpaper, the input is the item and the output is the item with no curse. That would probably be the easiest method. In that case you check the item in slot1, when contents change, has the enchants like above. Then you check slot2, when contents change, has sandpaper then you add item from slot1 to slot3 and remove the specific curse(s). You then make a procedure for when contents are removed from slot3, remove item from slot1 and remove 1 sandpaper from slot2. You may need to save data across these procedures by using nbt/custom data/variables but should be doable without it, just by checking the currently open gui slots most likely through gui open tick event found in the bottom left of the gui edit screen when expanded.

Joined May 2025
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Thanks, if you have any…
Sun, 03/29/2026 - 07:08

Thanks, if you have any ideas on how to build this in procedures and make it so that it actually gets called please let me know. I decided to simply make a GUI where you have the input for the item, the sandpaper, and an output for the item if needed

Joined Jul 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
It is basically a 2x1…
Sun, 03/29/2026 - 15:00

It is basically a 2x1 crafting table, the crafting recipe being any item with a curse in slot 1 and sandpaper in slot 2.

https://imgbox.com/tPfr6DYp

First procedure is on gui open tick. You can then use the second one on the trigger: when item taken from slot (within the output slot 2). Where slot 0 is the item input, slot 1 is the sandpaper input, and slot 2 is the uncursed item output.

*Within the second procedure the second block should be slot 0*

You may also want to set the item in slot 2 to be air separately within: on gui closed trigger. That way players can't exploit the gui and get the output to drop if they close the gui while it is not bound. If the gui is bound to a block it shouldnt matter though.