I'm trying to replace all crafted Iron Chestplates with Chain Mail ones for a hard survival multiplayer world

My initial idea was to detect when an Iron Chestplate is applied to the armor.chest inventory slot and to use /replaceitem to turn it to chainmail. I am not skilled enough with /execute /replaceitem /scoreboard /data or any higher level commands for any of this. Any ideas?


Solution 1:

Use this command in a repeat Command Block (1.13+):

/execute as @a[nbt={Inventory:[{Slot:102b,id:"minecraft:iron_chestplate"}]}] run replaceitem entity @s armor.chest minecraft:chainmail_chestplate 1

However, this will only work once the Iron Chestplate is placed in the player's armor slot.