How can you make an armor that has infinite protection armor?

Solution 1:

At the end of the command, there is an unnecessary '}': 99]},Slot:"head"}]} By removing the first one so it looks like: 99],Slot:"head"}]} it worked for me in both 1.16.5 and snapshot 21w08b.

This command adds armor points to the item but you don't get the armor toughness nor the knockback resistance that you get from a normal netherite helmet. Instead of adding infinite armor, you could add infinite armor toughness that would theoretically make every armor point of the item block infinite damage (haven't tested this), i.e. "generic.armor_toughness".

Another solution is to add a tag to the item and use the /data command to change the damage count, ether constantly, or to check for when any damage has been taken in a repeating command block or a data pack.

You can find the different attributes at the link below: https://minecraft.gamepedia.com/Attribute#Attributes_available_on_all_living_entities