I am making a datapack that adds weight (slight movement speed penalty) to armor using attributes. I got it working for players using the command:
execute as @e[type=player,nbt={Inventory:[{Slot:100b}]},nbt=!{Inventory:[{Slot:100b,tag:{realistic:1}}]}] run item modify entity @s armor.feet minecraft:replace_boots
But I would like to also apply this to the armor worn by mobs. How do I test if a mob has any type of armor in a specific slot? Something to the effect of:
/execute as @e[nbt={ArmorItems:[{Slot:Chest}]}] run say hi
Otherwise, I have to have 24 commands (4 for each of the 6 tiers of armor).