This question already has an answer here:

I really want to know how to do that

marked as duplicate by Ben, galacticninja, greg-449, Joachim, Timmy Jim Oct 14 at 11:00

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • If you are on education edition, which I highly doubt that you are but just want to put this out there for anybody using education edition, use /worldimmutable. – brododragon Oct 14 at 2:26

The easiest method is to use cheat

/give @p minecraft:YOURITEM 1 0 {Unbreakable:1}

You can use the following command:

/give @p minecraft:stick{Enchantments:[{id:"minecraft:unbreaking",lvl:2147483647}]} 1

Also change stick for your item of choice.

  • 2
    I am not Minecraft Command expert, but what exactly will adding Sharpness do to make an item unbreakable? – The Mattbat999 Oct 13 at 21:16
  • Sorry. Edited it know – Duarte Arribas Oct 14 at 18:24

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