Started by
X11_OmegalingYT
on
Topic category: Help with Minecraft modding (Java Edition)
Is there a way to make is so mobs can occasionally spawn with armor, similarly to how Zombies and Skeletons do, where they don't always spawn with it, but can sometimes?
Maybe create a copy of that mob that can only spawn with armor, and make it rarer than the first mob.
Execute this command when the entity of your choice spawns:
/data merge entity @e[type=zombie,limit=1,sort=nearest] {ArmorItems:[{},{},{id:golden_chestplate,Count:1}],ArmorDropChances:[0f,0f,0f]}
Replace the golden chestplate with the item of your choice. Alternatively, just have a procedure that changes the item in the armor slot of the nearest entity of the desired type to your custom item.