I need help with changing a summon command to work in 1.20.5. The command appears to be correct, however, when I summon the mob it has armor/weapons but the enchantments don't work.
The command is:
/summon zombified_piglin ~1 ~ ~-2 {CustomName:"\"Bank Guard \"",Team:Blue, Tags:[BAUnit1_B],PersistenceRequired:1,HandItems:[{Count:1,id:golden_sword,tag:{Enchantments:[{id:sweeping_edge,lvl:4},{id:unbreaking,lvl:3}]}},{}],ArmorItems:[{Count:1,id:golden_boots,tag:{Enchantments:[{id:protection,lvl:1}]}},{Count:1,id:golden_leggings,tag:{Enchantments:[{id:protection,lvl:1}]}},{Count:1,id:golden_chestplate,tag:{Enchantments:[{id:protection,lvl:1}]}},{Count:1,id:golden_helmet,tag:{Enchantments:[{id:protection,lvl:1}]}}],IsImmuneToZombification:1b}
Also can you please explain how it works so that I can apply to all my other summon commands I use in my map I am creating? I don't need an example of necessarily every attribute in this command just anything that may differ in how it is typed.