# Find if it will be cursed (luck based)
execute if score summon_cursed EB_generic matches -1 run function 0_enemy_boss:is_summon_cursed

# Summon if not cursed
execute if score summon_cursed EB_generic matches 0 run summon drowned ~ ~ ~ {CustomName:'{"translate":"drowned_fisherman","color":"dark_aqua","italic":false}',CustomNameVisible:1,Health:20.00,Attributes:[{Name:"generic.max_health",Base:20.00},{Name:"generic.follow_range",Base:18.00},{Name:"generic.attack_damage",Base:5.00},{Name:"generic.movement_speed",Base:0.23}],HandItems:[{Unbreakable:1b,id:"wooden_sword",Count:1,tag:{AttributeModifiers:[{AttributeName:"generic.attack_damage",Name:"generic.attack_damage",Amount:0,Operation:0,UUID:[I;1,1,1,1]}],CustomModelData:3502,Enchantments:[{id:"minecraft:knockback",lvl:3s}]}},{}],ArmorItems:[{},{},{},{}],Tags:['enemy', 'drowned_fisherman', 'EB', 'init', 'water_speed_I', 'custom_attack'],DeathLootTable:"mdd:drop_marker",HandDropChances:[0.0F,0.0F],ArmorDropChances:[0.0F,0.0F,0.0F,0.0F]}

# Summon if cursed
execute if score summon_cursed EB_generic matches 1 run summon drowned ~ ~ ~ {CustomName:'{"translate":"drowned_fisherman","color":"dark_aqua","italic":false}',CustomNameVisible:1,Health:26.00,Attributes:[{Name:"generic.max_health",Base:26.00},{Name:"generic.follow_range",Base:19.80},{Name:"generic.attack_damage",Base:6.50},{Name:"generic.movement_speed",Base:0.23}],HandItems:[{Unbreakable:1b,id:"wooden_sword",Count:1,tag:{AttributeModifiers:[{AttributeName:"generic.attack_damage",Name:"generic.attack_damage",Amount:0,Operation:0,UUID:[I;1,1,1,1]}],CustomModelData:3502,Enchantments:[{id:"minecraft:knockback",lvl:3s}]}},{}],ArmorItems:[{},{},{},{}],Tags:['enemy', 'drowned_fisherman', 'EB', 'init', 'water_speed_I', 'cursed', 'custom_attack'],DeathLootTable:"mdd:drop_marker",HandDropChances:[0.0F,0.0F],ArmorDropChances:[0.0F,0.0F,0.0F,0.0F]}

# Mark if it's a boss spawn
execute if score boss_spawn EB_generic matches 1 run tag @e[tag=drowned_fisherman,tag=init,sort=nearest,limit=1] add boss_spawn

# Spawn count
execute if score spawn_count EB_generic matches 1 run scoreboard players add #enemies_spawned EB_generic 1

# Reset flags
scoreboard players set summon_cursed EB_generic -1
scoreboard players set boss_spawn EB_generic 0
scoreboard players set spawn_count EB_generic 1

# Custom commands
# Clear Init tag
tag @e[tag=drowned_fisherman,tag=init,sort=nearest,limit=1] remove init