15

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.

  • What you wanna do: Testfor Break3 armor -> remove Break3 armor -> /give Break5 armor. correct? – 54D Apr 8 '15 at 14:25
  • @ArceusMaster0493 They also seem to want to keep "the same previous enchants" that are on the armor. – SirBenet Apr 8 '15 at 16:25
  • @colorfusion Maybe that means that if there are other enchants, like Protection 2, for example, it won't remove them. Not sure though. – 2xedo Apr 8 '15 at 18:55
  • OP can you clarify it? – 54D Apr 9 '15 at 8:17
  • 3
    Well a dumb solution is to add a set of command blocks for every enchant and item combo – ModDL Apr 15 '15 at 1:47
3

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 )

0

Unless you have a two command blocks constantly checking for the tool in one hand and the armour in the other, and have command blocks testing for all enchantment combinations AND testing for the xp level, and somehow linking them all to one output, this system is impossible.

The problem with this task is format. A villager generated through a command generator that gives you specific trade that takes a tool (eg. sword) and an item only accessible through a testfor command that detects a certain amount of xp, notifies the player, then gives the second item(eg. emerald). Therefore the villager would trade a Sharpness III sword and 1 paper to give you a Sharpness V sword. This can obviously be adapted for anything you like. A website I recommend is called MCStacker.

-1

Well here's the problem: you are unable to hold multiple objects in your hand! You are trying to enchant armor while holding a tool and that's an issue. Try holding the armor instead and enchanting it that way.

-1

Have you tried using /testfor to find a player with the item then using /replaceitem entity Bob slot.hotbar.0 minecraft:diamond_sword 1 0 {ench:[{id:34,lvl:5}]} -That sets the first hotbar slot of the player named "Bob" to a diamond sword.

-1

well the first thing to do is see if you need to verify/enchant.... so check for the level 3 you require for the upgrade.

if less than three skip the rest and reject...... but if three (or more for lazy way,) you need to figure out everything it holds so>>>>

the following will assume no over enchantments will exist and if it finds an over enchantment this LAZY WAY will set that enchantment to the maximum. this method is already very long and complimented so this assumption will give you more hair pulling before you decide to kill yourself due to how complicated it is (jk on kill yourself but really, redstone is very simple) so , on to it

there was a list of enchantments listed by what they enchant.... it was down voted by at least three people with their heads so far up their "where the sun don't shine" that you should immediately ignore everything they say.... too bad we don't have a complete list of them.... on to the list.

that list helps to limit what to check for so on the list of the item in question, the range is 32 - 35 but you already know unbreaking so don't have to check for that.

after each check (32, 33, and 35) you will need to save the value returned... rs latch for each level and each enchantment (don't forget an rs latch for level zero of each) then simply set the correct latch for each three

now you have over a dozen rs latches but only three of them are set. a command block tree can select the correct /give command for giving your upgraded tool. to allow multiple overclocked enchantments would be easier if there is a way to pass a number to the /give command but i doubt that is possible so while this lazy way has only 48 possible /give commands if you were trying to jump increase armor the command tree would be 80,000 - 200,000 depending on what enchantment you were increasing

that all said, I have a less than automatic way to do this but WAY WAY simpler it is different from you intention so i will place in a separate answer

-2

All you need to do is:

/give <username> minecraft:diamond_sword 1 0 {each:[{id:16,lvl:10}]} 

This is for a sharp X diamond sword.

This goes all the way up to level 32780.

  • 1
    How would OP keep the previous enchantments that are already on their weapon, as asked in the question? – SirBenet Jul 6 '15 at 20:24
-3

You can use 'clear', then 'give' to give an enchanted item.

First, make a command block with 'clear @p diamond_sword', then add a comparator leading into another command block:

'give @p diamond_sword 1 0 {ench:[{id:diamond_sword,lvl:5}]}'

You can do the same for armor and other tools.

  • This does not keep the enchantments on the item as OP requested. – SirBenet Apr 16 '15 at 16:27
  • Whoops, didn't realize. Is it not an option to give a whole new item with unbreaking and the new enchant? – A.J. Ruckman Apr 16 '15 at 21:57
-3

Here is a list of enchantments:

Armor

  • 0.protection
  • 1.fire_protection
  • 2.feather_falling
  • 3.blast_protection
  • 4.projectile_protection
  • 5.resperation
  • 6.aqua infinity
  • 7.thorns
  • 8.depth_strider Weapons

  • 16.sharpness

  • 17.smite
  • 18.bane of atropods
  • 19.knockback
  • 20.fire aspect
  • 21.looting

Tools

  • 32.efficiency
  • 33.silk touch
  • 34.unbreaking
  • 35.fortune

Bows

  • 48.power
  • 49.punch
  • 50.flame
  • 51.infinity
  • What has this got to do with the question? – angussidney Jul 25 '15 at 1:35
-3

Easy to do! just go the minecraftcommand.science and there you can make your own commands for example a diamond sword with sharpness 1000000000

(even though that will only do 8 damage as it passes the limit)

  • How does this allow OP to enchant an item whilst keeping the item's previous enchantments? – SirBenet Aug 4 '15 at 14:08

Not the answer you're looking for? Browse other questions tagged or ask your own question.