enchantments transfer

Started by SPFC on

Topic category: Help with Minecraft modding (Java Edition)

Joined Feb 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
enchantments transfer

i'm making a block that has a GUI, and I'm trying to make that GUI transfer all enchantments of an item in one slot, to another item in another slot, with a press of a button.

I have the button part down, but the "enchantment transfer" part is what I'm having trouble with.

Joined Apr 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
copy data components of …
Fri, 10/10/2025 - 07:14

copy data components of [first item] onto [second item]
but it also copies damage of item
if you don't want that, then before copying data components make NUMBER local variable of second item's damage
then after data component is copied, set damage of [second item] to that variable.