execute as @e[type=zombie,tag=!plussed] at @s if data entity @n[type=chicken,distance=..1] Passengers run function survivalplus:mobs/jockey
execute as @e[type=zombie,tag=!plussed] run data merge entity @s {DeathLootTable:"survivalplus:entities/zombie"}
execute if score hardmode hardmode matches 1 if score bloodmoon time matches 1 if score time time matches 13000..23400 run function survivalplus:mobs/butcher
execute if score bloodmoon time matches 1 if score time time matches 13000..23400 run function survivalplus:mobs/wraith
execute if score bloodmoon time matches 1 if score time time matches 13000..23400 run function survivalplus:mobs/zomhorseman

#execute as @e[type=zombie,tag=!plussed,predicate=survivalplus:spawnermob] run data merge entity @s {IsBaby:0b,Health:40,Tags:[plussed,spawner,rare,lowregen],CanPickUpLoot:0b,equipment:{legs:{id:stick,components:{enchantments:{"survivalplus:spawner":1},custom_data:{del:tag}}},head:{id:spawner}},attributes:[{id:"armor",base:10f},{id:"knockback_resistance",base:0.7f},{id:"attack_knockback",base:2f},{id:"max_health",base:40f},{id:"armor_toughness",base:4f},{id:"movement_speed",base:0.2f}],drop_chances:{legs:0f,head:0f},DeathLootTable:"survivalplus:entities/spawner_mob"}

#merchants
execute unless entity @e[tag=zombmerchant] as @e[type=zombie,predicate=survivalplus:can_see_sky,predicate=survivalplus:2chance,tag=!plussed,limit=1] at @s run function survivalplus:merchants/readyzombmerchant

execute if score hardmode hardmode matches 1 unless entity @e[tag=hmmerchant] as @e[type=zombie,predicate=survivalplus:can_see_sky,predicate=survivalplus:2chance,tag=!plussed,limit=1] at @s run function survivalplus:merchants/readyhmmerchant

#execute if score hardmode hardmode matches 1 unless entity @e[tag=crystalmerchant] run execute as @e[type=zombie,predicate=survivalplus:underground,predicate=survivalplus:2chance,tag=!plussed,limit=1] run data merge entity @s {IsBaby:0b,Health:50,CanPickUpLoot:0b,CustomName:{"text":"Gem Merchant"},Tags:[merchant_face,rare,plussed,spawnmerchant,crystalmerchant,crysmerc,mineable,crys,upgradeable,nopoly],equipment:{mainhand:{id:golden_pickaxe,components:{unbreakable:{},item_name:{"text":"Swift Drill","italic":false},attribute_modifiers:[{type:"mining_efficiency",amount:100,slot:mainhand,id:"0172637182312-7318",operation:add_value},{type:"attack_damage",amount:1,slot:mainhand,id:"-237182769813691",operation:add_value},{type:"attack_speed",amount:-2.6,slot:mainhand,id:"32671892601-217389",operation:add_value}]}},legs:{id:leather_leggings},chest:{id:leather_chestplate,components:{dyed_color:8991416}},head:{id:amethyst_cluster}},attributes:[{id:"movement_speed",base:0.23f},{id:"attack_damage",base:4f},{id:"attack_knockback",base:2.5f},{id:"knockback_resistance",base:0.6f},{id:"max_health",base:80f}],drop_chances:{mainhand:1f,chest:0f,head:0f},DeathLootTable:"minecraft:blocks/amethyst_cluster"}
#execute at @e[type=zombie,tag=spawnmerchant,tag=crystalmerchant] run summon villager ~ ~ ~ {isbaby:0b,CustomName:"Gem Merchant",VillagerData:{id:plains,profession:nitwit,level:99,Offers:{}},CustomName:{"text":"Gem Merchant"},Invulnerable:1b,NoAI:1b,Silent:1b,Tags:[merchant,plussed,crystalmerchant,crysmerc,addtrades],Team:merchant,active_effects:[{id:invisibility,duration:-1,show_particles:0b}],equipment:{mainhand:{id:bundle},offhand:{id:amethyst_cluster}},drop_chances:{mainhand:0f,offhand:0f},DeathLootTable:""}
#execute as @e[tag=crystalmerchant,type=villager,tag=addtrades] run function survivalplus:merchants/gemmerchanttrades
#execute as @e[tag=spawnmerchant,type=zombie,tag=crystalmerchant] run tag @s remove spawnmerchant

execute unless entity @e[tag=gravedigger] if score time time matches 13000..23400 run execute as @e[type=zombie,tag=!plussed,predicate=survivalplus:1chance,predicate=survivalplus:overworld,predicate=survivalplus:can_see_sky,limit=1] run data merge entity @s {CanPickUpLoot:0b,IsBaby:0b,CustomName:{"text":"The Gravedigger"},Health:70,PersistenceRequired:1b,Tags:[gravedigger,rare,boss,plussed,armorable,upgradeable,nopoly,lowregen,special,addarmor],equipment:{mainhand:{id:diamond_shovel},feet:{id:"minecraft:leather_boots",components:{enchantments:{blast_protection:2,soul_speed:1}}},legs:{id:"minecraft:chainmail_leggings",components:{trim:{pattern:tide,material:iron},enchantments:{projectile_protection:2,thorns:1}}},chest:{id:"minecraft:leather_chestplate",components:{trim:{pattern:vex,material:copper}}},head:{id:"minecraft:leather_helmet",components:{trim:{pattern:sentry,material:copper},enchantments:{fire_protection:2}}}},drop_chances:{mainhand:0f,feet:0f,legs:0f,chest:1f,head:0f},attributes:[{id:"armor",base:6f},{id:"attack_damage",base:0.5f},{id:"knockback_resistance",base:0.5f},{id:"max_health",base:70f},{id:"spawn_reinforcements",base:0.6f}]}
loot replace entity @e[tag=gravedigger,tag=addarmor] armor.chest loot survivalplus:panic_speed
tag @e[tag=gravedigger,tag=addarmor] remove addarmor
#execute as @e[tag=gravedigger,tag=!surfaced] at @s run spreadplayers ~ ~ 0 1 false @s
#tag @e[tag=gravedigger,tag=!surfaced] add surfaced
execute as @e[type=zombie,tag=!plussed,predicate=survivalplus:deep_cave,predicate=survivalplus:2chance] unless entity @e[tag=undead_miner,distance=..10] run data merge entity @s {CanBreakDoors:1b,IsBaby:0b,CustomName:{"text":"Undead Miner"},Health:40,CanPickUpLoot:0b,Tags:[plussed,undead_miner,rare,armorable,upgradeable],equipment:{mainhand:{id:iron_pickaxe,components:{custom_data:{minerpick:tag},rarity:uncommon,item_name:{"text":"Miner's Pickaxe","italic":false},lore:[{"text":"Gain speed boost when walking on stone type blocks","italic":false,"color":"gray"}],attribute_modifiers:[{type:"mining_efficiency",amount:.2,slot:mainhand,id:"12723901423427310",operation:add_multiplied_base},{type:"mining_efficiency",amount:5,slot:mainhand,id:"0172637182312-7318",operation:add_value},{type:"attack_damage",amount:3,slot:mainhand,id:"-237182769813691",operation:add_value},{type:"attack_speed",amount:-2.6,slot:mainhand,id:"32671892601-217389",operation:add_value}]}},offhand:{id:torch,count:9},feet:{id:iron_boots},chest:{id:leather_chestplate,components:{dyed_color:3949738}},head:{id:golden_helmet}},drop_chances:{mainhand:1f,feet:0f,chest:0f,head:0f},attributes:[{id:"attack_damage",base:4f},{id:"armor",base:8f},{id:"max_health",base:40f},{id:"knockback_resistance",base:0.5f},{id:"movement_speed",base:0.28f},{id:"armor_toughness",base:4f}],DeathLootTable:"survivalplus:entities/undead_miner"}
#execute unless entity @e[tag=player1] run execute as @e[type=zombie,tag=!plussed,predicate=survivalplus:surface,predicate=survivalplus:2chance,limit=1] run data merge entity @s {IsBaby:0b,CanBreakDoors:0,CustomName:{"text":"ZombieMan224"},CustomNameVisible:1b,Health:20,CanPickUpLoot:0b,PersistenceRequired:1b,Tags:[player1,rare,plussed,player,special,nopoly],HandItems:[{id:stone_sword}],HandDropChances:[1f,1f],equipment:{feet:{id:leather_boots},{id:leather_leggings},{id:iron_chestplate},{id:iron_helmet,components:{Unbreakable:1}}],ArmorDropChances:[1f,1f,1f,0f],attributes:[{id:"max_health",base:20f},{id:"movement_speed",base:0.3f},{id:"attack_damage",base:-0.5f},{id:"follow_range",base:15f}],DeathLootTable:"survivalplus:entities/playerloot1"}
execute unless entity @e[tag=player1] run execute as @e[type=zombie,tag=!plussed,predicate=survivalplus:surface,predicate=survivalplus:2chance,limit=1] at @s unless entity @a[distance=..20] run function survivalplus:mobs/player/player1
execute if score hardmode hardmode matches 1 as @e[type=zombie,tag=!plussed,predicate=survivalplus:10chance] run data merge entity @s {Tags:[plussed,boom,notlit],Health:25,equipment:{head:{id:tnt}},attributes:[{id:"armor",base:4f},{id:"attack_damage",base:5f},{id:"attack_knockback",base:1f},{id:"knockback_resistance",base:0.2f},{id:"movement_speed",base:0.23f},{id:"max_health",base:25f}],drop_chances:{head:0f},DeathLootTable:"minecraft:entities/creeper"}
execute if score hardmode hardmode matches 1 as @e[type=zombie,tag=!plussed,predicate=survivalplus:10chance,predicate=survivalplus:deep_cave] at @s unless entity @a[distance=..20] run data merge entity @s {Health:50,Tags:[plussed,mineable,deep],CanPickUpLoot:0b,equipment:{chest:{id:leather_chestplate,components:{dyed_color:4673362}},head:{id:deepslate}},attributes:[{id:"attack_damage",base:6f},{id:"movement_speed",base:0.2f},{id:"knockback_resistance",base:0.8f},{id:"max_health",base:50f},{id:"armor_toughness",base:10f},{id:"armor",base:20f}],drop_chances:{chest:0f,head:0f},DeathLootTable:"survivalplus:entities/deep_mineable"}
execute if score hardmode hardmode matches 1 as @e[type=zombie,tag=!plussed,predicate=survivalplus:10chance,predicate=survivalplus:cave] at @s unless entity @a[distance=..20] run data merge entity @s {Health:50,Tags:[plussed,mineable,cave],CanPickUpLoot:0b,equipment:{chest:{id:leather_chestplate,components:{dyed_color:10329495}},head:{id:stone}},attributes:[{id:"attack_damage",base:6f},{id:"movement_speed",base:0.2f},{id:"knockback_resistance",base:0.8f},{id:"max_health",base:50f},{id:"armor_toughness",base:10f},{id:"armor",base:15f}],drop_chances:{chest:0f,head:0f},DeathLootTable:"survivalplus:entities/cave_mineable"}
execute if score hardmode hardmode matches 1 as @e[type=zombie,tag=!plussed,predicate=survivalplus:1chance,predicate=survivalplus:underground] run data merge entity @s {IsBaby:0b,Health:40,Tags:[plussed,spawner,rare,lowregen],CanPickUpLoot:0b,equipment:{legs:{id:stick,components:{enchantments:{"survivalplus:spawner":1},custom_data:{del:tag}}},head:{id:spawner}},attributes:[{id:"armor",base:10f},{id:"knockback_resistance",base:0.7f},{id:"attack_knockback",base:2f},{id:"max_health",base:40f},{id:"armor_toughness",base:4f},{id:"movement_speed",base:0.2f}],drop_chances:{legs:0f,head:0f},DeathLootTable:"survivalplus:entities/spawner_mob"}
execute as @e[type=zombie,tag=!plussed,predicate=survivalplus:2chance] at @s if biome ~ ~ ~ minecraft:lush_caves run data merge entity @s {Health:34,Tags:[plussed,bushzombie,rare,bushme],CanBreakDoors:1b,CanPickUpLoot:0b,equipment:{head:{id:azalea}},drop_chances:{head:.4f},attributes:[{id:"attack_damage",base:6f},{id:"movement_speed",base:0.28f},{id:"knockback_resistance",base:0.5f},{id:"max_health",base:30f}]}
execute as @e[tag=bushme] run function survivalplus:mobs/upgrade/armor/bushme
execute as @e[type=zombie,tag=!plussed,predicate=survivalplus:20chance] at @s if biome ~ ~ ~ minecraft:lush_caves run data merge entity @s {Health:30,Tags:[plussed],CanBreakDoors:1b,CanPickUpLoot:0b,equipment:{head:{id:big_dripleaf}},attributes:[{id:"attack_damage",base:7f},{id:"movement_speed",base:0.28f},{id:"knockback_resistance",base:0.5f},{id:"max_health",base:30f}]}
execute as @e[type=zombie,tag=!plussed,predicate=survivalplus:10chance] run data merge entity @s {Health:30,Tags:[plussed],CanBreakDoors:1b,CanPickUpLoot:1b,equipment:{mainhand:{id:wooden_sword},chest:{id:iron_chestplate},head:{id:chainmail_helmet}},drop_chances:{chest:0f,head:0f},attributes:[{id:"attack_damage",base:7f},{id:"movement_speed",base:0.3f},{id:"knockback_resistance",base:0.5f},{id:"max_health",base:30f},{id:"armor_toughness",base:4f}]}
execute if score warden death matches 1 as @e[type=zombie,tag=!plussed,predicate=survivalplus:2chance,predicate=survivalplus:deep_cave] run data merge entity @s {Health:30,Tags:[plussed,special,sculkzom,sculk,rare],CanBreakDoors:0b,CanPickUpLoot:0b,equipment:{mainhand:{id:air},feet:{id:leather_boots,components:{dyed_color:0}},feet:{id:leather_leggings,components:{dyed_color:0}},chest:{id:leather_chestplate,components:{dyed_color:0}},head:{id:sculk}},attributes:[{id:"attack_damage",base:6f},{id:"movement_speed",base:0.26f},{id:"knockback_resistance",base:0.5f},{id:"max_health",base:30f},{id:"armor_toughness",base:2f}],drop_chances:{feet:0f,lesg:0f,chest:0f,head:1f},DeathLootTable:"survivalplus:entities/sculk_mob"}
execute as @e[type=zombie,tag=!plussed,predicate=survivalplus:10chance,predicate=survivalplus:raining,predicate=!survivalplus:desert_biome,predicate=!survivalplus:cold_biome] run data merge entity @s {Health:30,Tags:[plussed],CanBreakDoors:0b,CanPickUpLoot:0b,equipment:{mainhand:{id:fishing_rod},feet:{id:leather_boots,components:{dyed_color:3949738,enchantments:{"survivalplus:flippers":1}}}},chest:{id:leather_chestplate,components:{custom_data:{raincoat:tag},trim:{pattern:raiser,material:gold},dyed_color:16701501,item_name:{"text":"Raincoat","italic":false},lore:[{"text":"+25% Movement speed while wet","italic":false,"color":"gray"}],tooltip_display:{hidden_components:[dyed_color,trim]}}},head:{id:leather_helmet,components:{dyed_color:16701501}},attributes:[{id:"attack_damage",base:4f},{id:"movement_speed",base:0.29f},{id:"knockback_resistance",base:0.5f},{id:"max_health",base:30f}],drop_chances:{feet:0.2f,chest:0.25f,head:0f}}
execute as @e[type=zombie,tag=!plussed,predicate=survivalplus:25chance,predicate=survivalplus:50chance] run data merge entity @s {Health:30,Tags:[plussed,item_snatcher,not_stole],CanBreakDoors:1b,CanPickUpLoot:1b,attributes:[{id:"attack_damage",base:3.5f},{id:"movement_speed",base:0.3f},{id:"knockback_resistance",base:0.5f},{id:"max_health",base:30f},{id:"armor_toughness",base:2f},{id:"attack_damage",base:3f}],drop_chances:{mainhand:2f,offhand:2f}}
execute as @e[tag=item_snatcher] run function survivalplus:tools/armor/delthorns
execute as @e[type=zombie,tag=!plussed] run data merge entity @s {CanBreakDoors:1b,CanPickUpLoot:1b,Health:30,attributes:[{id:"knockback_resistance",base:0.5f},{id:"movement_speed",base:0.3f},{id:"max_health",base:30f},{id:"attack_damage",base:7f},{id:"armor_toughness",base:2f},{id:"armor",base:6f}]}
execute as @e[type=zombie,tag=!plussed] run tag @s add plussed
execute as @e[type=zombie,nbt={IsBaby:1b}] run attribute @s attack_damage modifier add 3278053c-647e-46ad-bd07-6e787cb86722 -0.25 add_multiplied_base
execute as @e[type=zombie,nbt={IsBaby:1b}] run attribute @s movement_speed modifier add e031c685-396b-415a-94c3-965d460ff3b6 -0.4 add_multiplied_base

execute as @e[type=zombie,predicate=survivalplus:nonheadenchant] run data remove entity @s equipment.head.components."minecraft:enchantments"