execute as @e[type=stray,tag=!plussed] run data remove entity @s equipment.mainhand.components."minecraft:enchantments"
#execute as @e[type=stray,tag=!plussed] run data merge entity @s {DeathLootTable:"survivalplus:entities/stray"}
#execute as @e[type=stray,tag=!plussed,predicate=survivalplus:skeleton_type/weaken] run data merge entity @s {Health:40,Tags:[plussed,weakener],equipment:{mainhand:{id:iron_sword,components:{enchantments:{"survivalplus:weakening":1}}},feet:{id:iron_boots,components:{trim:{pattern:shaper,material:iron}}},legs:{id:iron_leggings},chest:{id:chainmail_chestplate,components:{trim:{pattern:shaper,material:iron}}},head:{id:chainmail_helmet}},drop_chances:{mainhand:0.25f},attributes:[{id:"movement_speed",base:0.3f},{id:"knockback_resistance",base:0.5f},{id:"max_health",base:40f}],drop_chances:{feet:0f,legs:0f,chest:0f,head:0f}}
#execute as @e[type=stray,tag=!plussed,predicate=survivalplus:skeleton_type/skel_merc] run function survivalplus:mobs/vanish
#execute as @e[type=stray,tag=!plussed,predicate=survivalplus:skeleton_type/golden] run data merge entity @s {Health:25,CanPickUpLoot:0b,Tags:[plussed,rare,upgradeable,diamond,armorable],equipment:{mainhand:{id:diamond_axe,components:{attribute_modifiers:[{type:"movement_speed",amount:0.2,slot:mainhand,operation:add_multiplied_base,id:"-12281213578175115-27156"},{type:"max_health",amount:-20,slot:mainhand,id:"-12281213678175115-27356",operation:add_value},{type:"attack_damage",amount:7,slot:mainhand,id:"-12281213778175115-27556",operation:add_value},{type:"attack_speed",amount:-2.8,slot:mainhand,id:"-12281213878175115-27756",operation:add_value}]}},feet:{id:diamond_boots,components:{attribute_modifiers:[{type:"max_health",amount:5,slot:feet,id:"-12351114306183548-28612",operation:add_value},{type:"armor",amount:2.5,slot:feet,id:"-12351114406183548-28812",operation:add_value}]}},legs:{id:diamond_leggings,components:{attribute_modifiers:[{type:"max_health",amount:5,slot:legs,id:"-12351118406183548-36812",operation:add_value},{type:"armor",amount:5,slot:legs,id:"-12351118506183548-37012",operation:add_value},{type:"armor_toughness",amount:1.5,slot:legs,id:"-12351118606183548-37212",operation:add_value}]}},chest:{id:diamond_chestplate,components:{attribute_modifiers:[{type:"max_health",amount:5,slot:chest,id:"-12351119906183548-39812",operation:add_value},{type:"armor",amount:6,slot:chest,id:"-12351120006183548-40012",operation:add_value},{type:"armor_toughness",amount:1.5,slot:chest,id:"-12351120106183548-40212",operation:add_value}]}},head:{id:diamond_helmet,components:{attribute_modifiers:[{type:"max_health",amount:5,slot:head,id:"-12351121406183548-42812",operation:add_value},{type:"armor",amount:2.5,slot:head,id:"-12351121506183548-43012",operation:add_value}]}}},drop_chances:{mainhand:.25f,feet:.15f,legs:.15f,chest:.15f,head:.15f},attributes:[{id:"max_health",base:25f},{id:"armor",base:-5f},{id:"movement_speed",base:0.24f},{id:"knockback_resistance",base:0.5f},{id:"attack_damage",base:1f},{id:"attack_knockback",base:2f}]}
#execute as @e[type=stray,tag=!plussed,predicate=survivalplus:skeleton_type/commando] run data merge entity @s {CanPickUpLoot:0b,CustomName:{"text":"Stray Commando"},Health:25,Tags:[plussed,rare,commander,special,loading],equipment:{mainhand:{id:bow,components:{enchantments:{"survivalplus:explosive":1}}},feet:{id:leather_boots,components:{trim:{pattern:snout,material:netherite},dyed_color:5263440,enchantments:{blast_protection:2,projectile_protection:2}}},legs:{id:iron_leggings},chest:{id:leather_chestplate,components:{trim:{pattern:snout,material:netherite},dyed_color:5263440,enchantments:{blast_protection:2,projectile_protection:2}}},head:{id:turtle_helmet,components:{trim:{pattern:rib,material:emerald},enchantments:{blast_protection:4}}}},attributes:[{id:"armor",base:-8f},{id:"max_health",base:25f},{id:"knockback_resistance",base:0.5f}],drop_chances:{mainhand:1f,feet:0f,legs:0f,chest:0f,head:0f}}
#execute as @e[type=stray,tag=!plussed,predicate=survivalplus:skeleton_type/swapper] run data merge entity @s {Tags:[plussed,swapper_mage,armorable],CustomName:{"text":"Swapper"},Health:25,CanPickUpLoot:0b,equipment:{mainhand:{id:bow,components:{enchantments:{punch:1}}},feet:{id:leather_boots,components:{trim:{pattern:vex,material:diamond},dyed_color:7982310}},legs:{id:leather_leggings,components:{trim:{pattern:vex,material:diamond},dyed_color:7982310}},chest:{id:leather_chestplate,components:{trim:{pattern:vex,material:diamond},dyed_color:7982310}},head:{id:diamond_helmet,components:{dyed_color:7982310}}},drop_chances:{mainhand:0f,feet:0f,legs:0f,chest:0f,head:0f},attributes:[{id:"knockback_resistance",base:0.4f},{id:"max_health",base:25f},{id:"armor_toughness",base:8f},{id:"armor",base:10f},{id:"movement_speed",base:0.3f}],DeathLootTable:"survivalplus:entities/swap_mage"}
#execute as @e[type=stray,tag=!plussed,predicate=survivalplus:skeleton_type/polymorpher] run data merge entity @s {Tags:[plussed,poly_mage,rare,upgradeable,nopoly],CustomName:{"text":"Polymorpher"},Health:28,CanPickUpLoot:0b,equipment:{mainhand:{id:bow,components:{enchantments:{power:1}}},feet:{id:leather_boots,components:{trim:{pattern:sentry,material:amethyst},dyed_color:11289023}},legs:{id:leather_leggings,components:{trim:{pattern:sentry,material:amethyst},dyed_color:11289023}},chest:{id:leather_chestplate,components:{dyed_color:11289023}},head:{id:leather_helmet,components:{trim:{pattern:sentry,material:amethyst},dyed_color:11289023}}},drop_chances:{mainhand:0f,offhand:0f,feet:0f,legs:0f,chest:0f,head:0f},attributes:[{id:"knockback_resistance",base:0.4f},{id:"max_health",base:28f},{id:"armor_toughness",base:2f},{id:"armor",base:5f},{id:"movement_speed",base:0.3f}],DeathLootTable:"survivalplus:entities/poly_mage"}
#execute as @e[type=stray,tag=!plussed,predicate=survivalplus:skeleton_type/tim] run data merge entity @s {CustomName:{"text":"Frozen Tim"},CanPickUpLoot:0b,Tags:[tim,rare,plussed,upgradeable,armorable,nopoly],drop_chances:{mainhand:0f,legs:0f,chest:0f,head:1f},equipment:{mainhand:{id:bow,components:{enchantments:{"survivalplus:teleport_bolt":1}}},legs:{id:leather_leggings,components:{dyed_color:3949738}},chest:{id:leather_chestplate,components:{trim:{pattern:vex,material:amethyst},dyed_color:3949738}},head:{id:leather_helmet,components:{custom_data:{wizardhat:tag},trim:{pattern:rib,material:copper},attribute_modifiers:[{type:"armor",amount:3,slot:head,id:"-12321231013232240-62026",operation:add_value}],item_name:{"text":"Wizard Hat","italic":false},lore:[{"text":"Chance to get +1 XP level on kill","italic":false,"color":"light_purple"}],tooltip_display:{hidden_components:[dyed_color,trim]}}}},attributes:[{id:"movement_speed",base:0.4f}]}
#execute as @e[type=stray,tag=!plussed,predicate=survivalplus:spawnermob] run data merge entity @s {Health:40,Tags:[plussed,spawner,rare],CanPickUpLoot:0b,equipment:{legs:{id:stick,components:{enchantments:{"survivalplus:spawner":1},custom_data:{del:tag}}},head:{id:spawner},mainhand:{id:bow}},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},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.23f},{id:"attack_damage",base:4f}],DeathLootTable:"survivalplus:entities/spawner_mob"}
#execute as @e[type=stray,tag=!plussed,name="Bad2TheBone",nbt={CustomNameVisible:1b},limit=1] run function survivalplus:tools/player/badbone/froze

#execute unless entity @e[tag=straymerchant] run execute as @e[type=stray,predicate=survivalplus:2chance,predicate=survivalplus:mountain,tag=!plussed,limit=1] run data merge entity @s {CanPickUpLoot:0,CustomName:{"text":"Stray Merchant"},Tags:[merchant_face,rare,plussed,spawnmerchant,straymerchant,straymerc],equipment:{mainhand:{id:redstone_torch},offhand:{id:shield},feet:{id:leather_boots,components:{dyed_color:16383998}},legs:{id:iron_leggings},head:{id:leather_helmet}},drop_chances:{mainhand:0f,offhand:0f,feet:0f,legs:0f,chest:0f,head:0f},DeathLootTable:"survivalplus:entities/merchant"}
#execute at @e[type=stray,tag=spawnmerchant] run summon villager ~ ~ ~ {CustomName:"Stray Merchant",VillagerData:{type:plains,profession:nitwit,level:99},Offers:{Recipes:[{maxUses:6,buy:{id:spruce_log,Count:16},sell:{id:"minecraft:barrel",components:{container_loot:{loot_table:"survivalplus:gameplay/crates/mountain"},item_name:{"text":"Mountain Crate","italic":false},enchantment_glint_override:1b,tooltip_display:{hidden_components:[container_loot]}}}},{maxUses:8,buy:{id:gunpowder,Count:8},sell:{id:beetroot_soup}},{maxUses:8,buy:{id:beetroot,Count:3},sell:{id:beetroot_seeds,Count:3}},{MaxUses:6,buy:{id:book},buyB:{id:experience_bottle,Count:8},sell:{id:knowledge_book,components:{rerolltome:tag,Recipes:[stick],item_name:{"text":"Reroll Tome","italic":false},rarity:epic,lore:[{"text":"Rerolls nearby mobs","italic":false,"color":"gray"}]}}},{maxUses:16,buy:{id:bone,Count:6},sell:{id:soul_torch,Count:4}},{maxUses:10,buy:{id:rotten_flesh,Count:6},sell:{id:bread,Count:2}},{maxUses:3,buy:{id:raw_gold,Count:5},sell:{id:potion,components:{potion_contents:{custom_color:16776960,custom_name:{"text":"Potion of Haste","italic":false},custom_potion_effects:[{id:haste,duration:1800,ambient:1b}]}}}}]},CustomName:{"text":"Stray Merchant"},Invulnerable:1b,NoAI:1b,Silent:1b,Tags:[merchant,plussed,straymerchant,straymerc],Team:merchant,active_effects:[{id:invisibility,duration:-1,show_particles:0b}],equipment:{mainhand:{id:bundle}},drop_chances:{mainhand:0f},DeathLootTable:"survivalplus:entities/merchant"}
#execute as @e[tag=spawnmerchant,type=stray] run tag @s remove spawnmerchant

execute unless entity @e[tag=ice_king] if score time time matches 13000..23400 run execute as @e[type=stray,tag=!plussed,predicate=survivalplus:1chance,predicate=survivalplus:surface,limit=1] run data merge entity @s {CustomName:{"text":"Ice Lich"},Health:80,PersistenceRequired:1b,Tags:[ice_king,boss,plussed,rare,upgradeable,nopoly,lowregen,special,iceme],equipment:{feet:{id:diamond_boots,components:{trim:{pattern:host,material:diamond}}},legs:{id:diamond_leggings,components:{trim:{pattern:raiser,material:diamond}}},chest:{id:diamond_chestplate,components:{trim:{pattern:raiser,material:quartz},enchantments:{projectile_protection:15}}},head:{id:golden_helmet,components:{trim:{pattern:spire,material:gold}}}},drop_chances:{mainhand:1f,feet:0f,legs:0f,chest:0f,head:0f},attributes:[{id:"armor",base:-1f},{id:"armor_thoughness",base:-5f},{id:"knockback_resistance",base:0.5f},{id:"attack_damage",base:1f},{id:"movement_speed",base:0.25f},{id:"max_health",base:80f}],DeathLootTable:""}
execute as @e[tag=iceme] run function survivalplus:mobs/gear/ice_king
execute as @e[type=stray,tag=!plussed,predicate=survivalplus:2chance] run data merge entity @s {Health:25,CanPickUpLoot:0b,Tags:[plussed,rare,upgradeable,ice_stray,armorable,icegearme],drop_chances:{mainhand:.25f},attributes:[{id:"max_health",base:25f},{id:"armor",base:-5f},{id:"movement_speed",base:0.24f},{id:"knockback_resistance",base:0.5f},{id:"attack_damage",base:1f},{id:"attack_knockback",base:2f}]}
execute as @e[tag=icegearme] run function survivalplus:mobs/gear/ice_stray
execute as @e[type=stray,tag=!plussed,predicate=survivalplus:25chance] run data merge entity @s {Health:35,CanPickUpLoot:1b,Tags:[plussed],equipment:{mainhand:{id:iron_sword},feet:{id:leather_boots},legs:{id:chainmail_leggings},chest:{id:iron_chestplate},head:{id:diamond_helmet}},drop_chances:{feet:0f,legs:0f,chest:0f,head:0f,mainhand:0f},attributes:[{id:"movement_speed",base:0.26f},{id:"knockback_resistance",base:0.5f},{id:"max_health",base:35f},{id:"armor_toughness",base:8f}]}
execute if score hardmode hardmode matches 1 as @e[type=stray,nbt={equipment:{mainhand:{id:"minecraft:iron_sword"}}},tag=!chillcheck] run function survivalplus:mobs/enchantchill
#execute if score hardmode hardmode matches 1 as @e[type=stray,tag=!plussed,predicate=survivalplus:20chance] run data merge entity @s {Health:35,Tags:[plussed,weakener],equipment:{mainhand:{id:iron_sword,components:{enchantments:{"survivalplus:weakening":1}}},feet:{id:iron_boots,components:{trim:{pattern:shaper,material:iron}}},legs:{id:iron_leggings},chest:{id:chainmail_chestplate,components:{trim:{pattern:shaper,material:iron}}},head:{id:chainmail_helmet}},drop_chances:{mainhand:0.25f,feet:0f,legs:0f,chest:0f,head:0f},attributes:[{id:"movement_speed",base:0.3f},{id:"knockback_resistance",base:0.5f},{id:"max_health",base:35f}]}
execute if score hardmode hardmode matches 1 as @e[type=skeleton,tag=!plussed,predicate=survivalplus:1chance] run data merge entity @s {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},mainhand:{id:bow}},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},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.23f},{id:"attack_damage",base:4f}],DeathLootTable:"survivalplus:entities/spawner_mob"}
execute as @e[type=stray,tag=!plussed,predicate=survivalplus:10chance] run data merge entity @s {Health:25,Tags:[plussed],CanPickUpLoot:0b,LeftHanded:1b,equipment:{mainhand:{id:bow,components:{enchantments:{"survivalplus:long_shot":1}}}},drop_chances:{mainhand:0.25f},attributes:[{id:"knockback_resistance",base:0.5f},{id:"movement_speed",base:0.3f},{id:"max_health",base:25f},{id:"armor_toughness",base:4f}]}
execute as @e[type=stray,tag=!plussed] run data merge entity @s {CanPickUpLoot:1b,Health:25,attributes:[{id:"knockback_resistance",base:0.5f},{id:"movement_speed",base:0.3f},{id:"max_health",base:25f},{id:"armor_toughness",base:4f}],equipment:{mainhand:{id:bow,components:{enchantments:{power:5}}}},drop_chances:{mainhand:0f}}
execute as @e[type=stray,tag=!plussed] run tag @s add plussed