Make tools indestructible in Minecraft

In Minecraft, is there any way to make tools indestructible (without using mods)? I want to make some tools indestructible (for an adventure map). Is it possible to do this using enchantments (or a command of some kind?)


Solution 1:

The closest you can get to that is enchanting your tools to make them last longer, increasing the uses significantly.

Another option for an adventure map would be to provide anvils through the map and hide raw materials that you could use to repair your tools.

Solution 2:

You can use "Unbreakable" NBT tag to make your items unbreakable. Example with a sword:

/give @a minecraft:diamond_sword 1 0 {Unbreakable:1}

Solution 3:

Items in Minecraft have a Damage value attached to them. For tools this is used to determine how much the item is damaged. For example, diamond tools break when this number reaches 1562 (their durability).

By casting an Unbreaking III enchantment on the tool (/enchant playername 24 3) you make it last 4 times as long: 1562·(1+3) = 6248 uses on average. The game doesn't let you enchant for a higher level.

If that's not enough for you, you will have to use an external game data editing program. Note that the program is only needed once. No mods will be required afterwards, neither for you, nor for the players of your map.

At first, make sure you have the desired tool (with Unbreaking already) in your Minecraft inventory, then close the world.
Now is a good time to make a backup of your world in case something goes wrong.

Let's use NBTEdit to edit the information about the tool.

  • Open the level.dat file inside your world's directory.

  • Go to DataPlayerInventory.

  • Select the entry which has the id of your tool (for example, a diamond pickaxe is 278).

  • Double-click on Damage and change the value to -32768 (-2^15, the smallest number short int data type can hold).

  • Open the item's tagench → "2 entries" and change the lvl to 10. (You can make the level even larger, but it won't look good in the game: "Unbreaking X" vs "Unbreaking enchantment.level.11").

  • Save the file.

Now you have an item with (32768+1562)·(1+10) = 377630 uses. Moreover, for the first 360448 uses (i.e. forever) the item won't have its damage bar displayed. Also, the tool doesn't even have to be diamond: a wooden tool will still have (32768+60)·(1+10) = 361108 uses.