# Summon
function bosses_py:0_spawn_boss

# Extra hp - each player adds 0.2 to the base 0.8 factor, up to 6 -> max factor 2
scoreboard players set #tmp game 8
execute as @a[limit=6] run scoreboard players add #tmp game 2
execute store result score boss_extra_hp game run data get entity @e[tag=boss,tag=EB,sort=nearest,limit=1] Attributes[{Name:"minecraft:generic.max_health"}].Base 100
scoreboard players operation boss_extra_hp game *= #tmp game
execute store result entity @e[tag=boss,tag=EB,sort=nearest,limit=1] Attributes[{Name:"minecraft:generic.max_health"}].Base double 0.001 run scoreboard players get boss_extra_hp game
execute store result entity @e[tag=boss,tag=EB,sort=nearest,limit=1] Health double 0.001 run scoreboard players get boss_extra_hp game


# Sound
playsound custom.wave.spawn.boss ambient @a ~ ~ ~ 2.5
