Is it possible to add attributes to armor?

I am trying to make it so when you wear a full set (or individual pieces) of armor it will give you speed 2. Is this possible to do without things like MC Edit?


Solution 1:

You can use this to execute a command as any player wearing diamond boots:

/execute as @a[nbt={Inventory:[{Slot:100b,id:"minecraft:diamond_boots}]}] run say I wear diamond boots.

You can use this to execute a command as any player wearing a full set of diamond armor:

/execute as @a[nbt={Inventory:[{Slot:100b,id:"minecraft:diamond_boots"},{Slot:101b,id:"minecraft:diamond_leggings"},{Slot:102b,id:"minecraft:diamond_chestplate"},{Slot:103b,id:"minecraft:diamond_helmet"}]}] run say I wear a full set of diamond armor.

You can use this to execute a command as any player wearing a full set of blue leather armor:

/execute as @a[nbt={Inventory:[{Slot:100b,id:"minecraft:leather_boots",tag:{display:{color:3949738}}},{Slot:101b,id:"minecraft:leather_leggings",tag:{display:{color:3949738}}},{Slot:102b,id:"minecraft:leather_chestplate",tag:{display:{color:3949738}}},{Slot:103b,id:"minecraft:leather_helmet",tag:{display:{color:3949738}}}]}] run say I wear a full set of blue leather armor.