execute as @e[type=pillager,tag=!plussed] run data merge entity @s {DeathLootTable:"survivalplus:entities/pillager"}
#execute as @e[type=pillager,tag=!plussed] unless data entity @s equipment.mainhand.id."minecraft:crossbow" run function survivalplus:mobs/passivepillager
#execute as @e[type=pillager,tag=!plussed,nbt={equipment:{head:{id:"minecraft:white_banner"}}}] run data merge entity @s {PatrolLeader:1b,Team:illager,Tags:[plussed,rare,illagercaptain],Health:30,equipment:{mainhand:{id:crossbow},head:{id:white_banner,components:{rarity:uncommon,item_name:{translate:"block.minecraft.ominous_banner"},banner_patterns:[{pattern:"rhombus",color:cyan},{pattern:"stripe_bottom",color:light_gray},{pattern:"stripe_center",color:gray},{pattern:"border",color:light_gray},{pattern:"stripe_middle",color:black},{pattern:"half_horizontal",color:light_gray},{pattern:"circle",color:light_gray},{pattern:"border",color:black}],tooltip_display:{hidden_components:[banner_patterns]}}}},attributes:[{id:"knockback_resistance",base:0.5f},{id:"movement_speed",base:0.3f},{id:"max_health",base:30f},{id:"armor_toughness",base:8f}],drop_chances:{head:1f}}
#execute as @e[type=pillager,tag=!plussed,nbt={equipment:{head:{id:"minecraft:white_banner"}}},predicate=survivalplus:20chance] run data merge entity @s {PatrolLeader:1b,Team:illager,Tags:[plussed,rare,illagercaptain,hatillager],Health:30,equipment:{mainhand:{id:crossbow},head:{id:white_banner,components:{rarity:uncommon,item_name:{translate:"block.minecraft.ominous_banner"},banner_patterns:[{pattern:"rhombus",color:cyan},{pattern:"stripe_bottom",color:light_gray},{pattern:"stripe_center",color:gray},{pattern:"border",color:light_gray},{pattern:"stripe_middle",color:black},{pattern:"half_horizontal",color:light_gray},{pattern:"circle",color:light_gray},{pattern:"border",color:black}],tooltip_display:{hidden_components:[banner_patterns]}}}},attributes:[{id:"knockback_resistance",base:0.5f},{id:"movement_speed",base:0.3f},{id:"max_health",base:30f},{id:"armor_toughness",base:8f}],drop_chances:{head:0f}}
execute as @e[type=pillager,tag=!plussed,nbt={equipment:{head:{id:"minecraft:white_banner"}}}] run data merge entity @s {PatrolLeader:1b,Team:illager,Tags:[rare,illagercaptain,noreroll,plussed,hatme],Health:30,equipment:{mainhand:{id:crossbow}},attributes:[{id:"knockback_resistance",base:0.5f},{id:"movement_speed",base:0.3f},{id:"max_health",base:30f},{id:"armor_toughness",base:8f}],drop_chances:{head:1f}}
execute as @e[type=pillager,tag=illagercaptain,tag=hatme,predicate=survivalplus:20chance] run function survivalplus:mobs/hatillager
tag @e remove hatme

execute unless entity @e[type=pillager,tag=burstpillager] as @e[type=pillager,tag=!plussed,predicate=survivalplus:2chance,limit=1] run data merge entity @s {Health:40,Tags:[plussed,burstpillager,rare,special],Team:illager,equipment:{mainhand:{id:crossbow,components:{enchantments:{"survivalplus:auto":1}}},head:{id:dark_oak_fence_gate}},drop_chances:{mainhand:1f,head:0f},attributes:[{id:"movement_speed",base:.3f},{id:"armor_toughness",base:8f},{id:"knockback_resistance",base:0.6f},{id:"armor",base:12f},{id:"max_health",base:40f}]}
execute if score hardmode hardmode matches 1 as @e[type=pillager,tag=!plussed,predicate=survivalplus:10chance] run data merge entity @s {Team:illager,Tags:[plussed],Health:40,attributes:[{id:"knockback_resistance",base:0.5f},{id:"movement_speed",base:0.3f},{id:"max_health",base:40f},{id:"armor_toughness",base:8f}],equipment:{mainhand:{id:crossbow,components:{enchantments:{"survivalplus:shotgun":1}}}}}
execute if score hardmode hardmode matches 1 as @e[type=pillager,tag=!plussed,predicate=survivalplus:5chance] run data merge entity @s {Team:illager,Tags:[plussed],Health:40,attributes:[{id:"knockback_resistance",base:0.5f},{id:"movement_speed",base:0.3f},{id:"max_health",base:40f},{id:"armor_toughness",base:8f}],equipment:{mainhand:{id:crossbow,components:{enchantments:{"survivalplus:velocity":1}}}}}

execute as @e[type=pillager,tag=!plussed,predicate=survivalplus:25chance] run data merge entity @s {Team:illager,Tags:[plussed],Health:30,attributes:[{id:"knockback_resistance",base:0.5f},{id:"movement_speed",base:0.3f},{id:"max_health",base:30f},{id:"armor_toughness",base:8f}],equipment:{mainhand:{id:crossbow,components:{enchantments:{multishot:1,piercing:1}}}},drop_chances:{mainhand:0f}}
execute as @e[type=pillager,tag=!plussed] run data merge entity @s {Team:illager,Health:30,equipment:{mainhand:{id:crossbow}},attributes:[{id:"knockback_resistance",base:0.5f},{id:"movement_speed",base:0.3f},{id:"max_health",base:30f},{id:"armor_toughness",base:8f}]}
execute as @e[type=pillager,tag=!plussed] run tag @s add plussed