Minecraft – How to you make an armor that has infinite protection armor

minecraft-commandsminecraft-java-edition

When I was using the new attribute command, I saw an attribute called "armor." I don't know what it actually does, but I think it has to do with protection. I was wondering if I could make an armor that has infinite protection so I tried to make a command:

give @s netherite_helmet{AttributeModifiers:[{AttributeName:"generic.armor",Name:"generic.armor",Amount:1.79769313486232E+308d,Operation:0,UUID:[I;439,684,724,99]},Slot:"head"}]}

I thought it would give me infinite protection, but it only gives me a helmet with the empty "protection" attribute. It works fine on older versions, but not on the 1.17 snapshots.

Best Answer

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

Related Topic