Minecraft – How to add an enchantment onto held item in Minecraft with command blocks

minecraft-commandsminecraft-java-edition

I want to have a button to enchant a piece of armor in my hand with Unbreaking V, if and only if:

  • The tool is already enchanted witch has Unbreaking III
  • The player has a minimum of 30 levels

I tried using /testfor for a certain enchantment on a certain item ID range, taking away 30 lvls, and then enchanting the item in-hand with /enchant. But it turns out you cannot use /enchant to make higher than default enchantment levels, you can only do that with the /give command.

I do not know how I am supposed to use the /give command because the item given has to have all the enchantments it had before it was enchanted with Unbreaking V.

Best Answer

Correct me if I'm wrong, but the only way would be to add command blocks for every single armor enchant and level combo in the game. (Unless you wanted to host a server on your computer running bukkit and just not allow anyone in. Then you could download essentials and use /enchant )