removing enchantments

Started by AltoidSE on Wed, 04/27/2022 - 04:40

Topic category: Help with MCreator software

Last seen on 08:13, 1. May 2022
Joined Apr 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
removing enchantments
Wed, 04/27/2022 - 04:40

is there a way to remove all enchants from an item instead of just one of them?

Last seen on 01:37, 29. Jun 2022
Joined Feb 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
I believe this would work…
Wed, 05/04/2022 - 09:56

I believe this would work. Set a local item variable to the itemstack. Set the local item variable to 1 item. Make a local text variable and set it to the item variable. Using the replace text procedure, replace text in the variable (Change "1 " to "" and " " to "_"0 (There are spaces, this changes a 1 followed by a space to nothing and any spaces in the text to underscores). Then execute the give command and use create text to combine give and the variable. I used this in my mod to add compatibility, and this would allow yours to remove enchantments from other mods. I haven't tested it with enchantments yet.