Forum: gaming.stackexchange.com
Tags: <minecraft-java-edition>
Title: Make tools indestructible in Minecraft
Question: 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?)

Answers:
sents: text: You can use "Unbreakable" NBT tag to make your items unbreakable.
text: Example with a sword: /give
text: @a minecraft:diamond_sword 1 0 {Unbreakable:1}
answer_details: author: gaming.stackexchange.com/users/66140/Atom
score: 38
sents: text: Items in Minecraft have a Damage value attached to them.
text: For tools this is used to determine how much the item is damaged.
text: For example, diamond tools break when this number reaches 1562 (their durability ).
text: By casting an Unbreaking III enchantment on the tool ( /enchant playername 24 3 )
text: you make it last 4 times as long: 1562·(1+3) = 6248 uses on average.
text: The game doesn't let you enchant for a higher level.
text: If that's not enough for you, you will have to use an external game data editing program.
text: Note that the program is only needed once.
text: No mods will be required afterwards, neither for you, nor for the players of your map.
text: At first, make sure you have the desired tool (with Unbreaking already) in your Minecraft inventory, then close the world.
text: Now is a good time to make a backup of your world in case something goes wrong.
text: Let's use NBTEdit to edit the information about the tool.
text: Open the level.dat file inside your world's directory.
text: Go to Data → Player → Inventory .
text: Select the entry which has the id of your tool
text: (for example, a diamond pickaxe is 278 ).
text: Double-click on Damage and change the value to -32768
text: ( -2^15 , the smallest number short int data type can hold).
text: Open the item's tag → ench → " 2 entries " and change the lvl to 10.
text: (You can make the level even larger, but it won't look good in the game: " Unbreaking X " vs " Unbreaking enchantment.level.11 ").
text: Save the file.
text: Now you have an item with (32768
text: +1562)·(1+10) = 377630 uses.
text: Moreover, for the first 360448 uses (i.e. forever) the item won't have its damage bar displayed.
text: Also, the tool doesn't even have to be diamond: a wooden tool will still have (32768+60)·(1+10) = 361108 uses.
answer_details: author: gaming.stackexchange.com/users/2267/BlaXpirit
score: 16
sents: text: The closest you can get to that is enchanting your tools to make them last longer, increasing the uses significantly.
text: 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.
answer_details: author: gaming.stackexchange.com/users/38193/M.Pagani
score: 12
sents: text: You can simply do this command (in a command bock).
text: Copy as so into game anything in the () .
text: It's your choice in what you want to put.
text: Note I did this in 1.7.2: /give
text: @p
text: diamond_sword {
text: Unbreakable:1,ench:[{id:(enchantment id),lvl:(enchantment
text: power),display:{Name:"(name of item)",Lore:["(a
text: little msg about anything)"]}}
text: You can extend things like the total enchants and lines of Lore some examplesmultiple enchants:
text: ench:[{id:(enchantment id),lvl:(enchantment power)},{id:(enchantment id),lvl:(enchantment power)},{ and so on.
text: More lore lines: Lore:["(a little msg about anything)","Lore:["(a little msg about anything)"," and so on.
answer_details: author: gaming.stackexchange.com/users/70088/Shinyshedinja707
score: 2
sents: text: If anyone is interested and need an indestructible item for Minecraft 1.2.5 and/or maybe for some Minecraft with SPC installed, try this: /item "number item" 1 -3000
answer_details: author: gaming.stackexchange.com/users/74681/Guest
score: 1
sents: text: /give
text: @a minecraft:diamond_sword 1 0 {Unbreakable:1} Completely works.
text: I tested it with a gold sword in 1.8.1 and it never lost any durability.
answer_details: author: gaming.stackexchange.com/users/93838/Someone who has a name
score: 1
sents: text: You can use command blocks: lets say 247 is a wooden sword (247 is not really a wooden sword, just an example), so do: give [playername or @p or something]
text: [item ID]
text: [amount]
text: [191918]
text: so it should look something like that:
text: give @p 247 1 191918 That will give you an indestructible sword!
answer_details: author: gaming.stackexchange.com/users/49148/user49148
score: 0

Summary of the answers:
Use Unbreakable NBT tag to make your items unbreakable.
While it is possible to make tools indestructible, the player might have to use illegitimate ways to achieve it.