How do I create an unbreakable bow in Minecraft Java Edition vanilla?

Solution 1:

I believe the right command is

/give @p minecraft:(put weapon here){Unbreakable:1} 1

Instead of the command you did. You will have to move your "1" after minecraft:bow to after {unbreakable:1}. Tell me if this does not work and what error you get.

Solution 2:

Your Problems

You have one problem and I have one suggestion.

Problem: You put the count before the nbt the syntax for the give command is the following.

/give <selector> <item>{<nbt>} <count>

So an example of the give command is the following.

/give @p minecraft:carrot_on_a_stick{Unbreakable:1} 1

My suggestion is to always specify the correct data type for your NBT tags. The Unbreakable tag is a Byte tag, and while it is okay to just type in a 1, the technical correct way is to specify a Byte: 1b

The Final Command

With the solutions specified, you get what follows.

/give @p minecraft:bow{Unbreakable:1b} 1