#chance to spawn undead horseman
execute at @s if predicate survivalplus:10chance unless entity @e[tag=zomhorseman] run summon minecraft:zombie_horse ~ ~ ~ {Tame:1b,Health:30,PersistenceRequired:1b,Tags:[rare,bloodhorse],attributes:[{id:"knockback_resistance",base:1f},{id:"armor",base:15f},{id:"movement_speed",base:0.25f},{id:"horse.jump_strength",base:0.7f},{id:"max_health",base:30f}],Passengers:[{id:zombie,CustomName:{"text":"Undead Horseman"},Health:35,PersistenceRequired:1b,Tags:[rare,plussed,zomhorseman],equipment:{mainhand:{id:diamond_sword,components:{enchantments:{knockback:1,smite:10}}},feet:{id:iron_boots,components:{trim:{pattern:silence,material:quartz}}},legs:{id:chainmail_leggings,components:{trim:{pattern:silence,material:iron}}},chest:{id:netherite_chestplate,components:{trim:{pattern:rib,material:copper},enchantments:{blast_protection:3,fire_protection:3,projectile_protection:2}}}},drop_chances:{mainhand:0f,feet:0f,legs:0f,chest:0f},attributes:[{id:"armor",base:2f},{id:"attack_damage",base:-.5f},{id:"attack_knockback",base:.5f},{id:"knockback_resistance",base:0.5f},{id:"movement_speed",base:0.25f},{id:"max_health",base:35f}],DeathLootTable:"survivalplus:entities/horseman"}]}
#choose loot set
item replace entity @s weapon.mainhand with bow[enchantments={power:4}]
execute if predicate survivalplus:25chance run item replace entity @s weapon.mainhand with iron_sword[enchantments={"survivalplus:chain_lightning":1}]
execute if entity @s[nbt={equipment:{mainhand:{id:"minecraft:iron_sword"}}}] run data merge entity @s {drop_chances:{mainhand:0.25f}}
tag @s add plussed