How can I enchant leather armor with a command block in Minecraft?

I'm trying to enchant leather armor using a command block. I want it to be red, with protection 1, and unbreakable. I did research for like an hour and I can't find anything about it, and hope anyone can help.
Thanks.


You can use 1.12 online command generators for this, one can be found on minecraftcommand.science. Here you can generate a command for any color and enchantments for your armor, and "convert" it to a newer format manually.

The command for red leather armor with Protection I and Unbreakable will look like this:

/give @p leather_helmet 1 0 {display:{color:16711680},ench:[{id:0,lvl:1}],Unbreakable:1}

The command for 1.13 and 1.14 looks like this:

/give @p leather_helmet{display:{color:16711680},Enchantments:[{id:protection,lvl:1}],Unbreakable:1}

What you need to do is move everything that's in brackets directly to the item ID, and remove the count and damage. After that, instead of ench type Enchantments, and replace the number ID of the enchantment with the name ID.

Of course, you can replace leather_helment by any other leather armor part.