##ID 1
#remove points
scoreboard players remove .points_temp arena 1
scoreboard players remove .points arena 1

#summon id27_mob x and y are random values
#$execute as @e[sort=random,limit=1,tag=enemies_spawnpoint] at @s run 
$summon bee ~ ~ ~ {Tags:["id27_bee"$(tag)],Silent:1b,PersistenceRequired:1b,AngerTime:4000000,Passengers:[{id:"minecraft:item_display",teleport_duration:1,Passengers:[{id:"minecraft:interaction",Silent:1b,CustomNameVisible:0b,Tags:["id27_mob","enemy","ranged","small","newborn","all_headshots"$(tag)],CustomName:'{"color":"white","text":"Willow Wisp"}',width:1.25f,height:1.25f}],transformation:{left_rotation:[0f,0f,0f,1f],right_rotation:[0f,90f,0f,1f],translation:[0f,0.75f,0f],scale:[1f,1f,1f]},item:{id:"minecraft:player_head",count:1,components:{"minecraft:profile":{properties:[{name:"textures",value:"eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvNGMzYzJmMmY5NDc3ODY1MjUzMTEyYzVhMWI2YzNiMTIzNmFlMjM0NjFlNTk2YWY3YTU5ODJkNWUyYjg1ZGUxNSJ9fX0="}]}}}}],active_effects:[{id:"minecraft:invisibility",amplifier:1,duration:199980,show_particles:0b}],attributes:[{id:"minecraft:attack_damage",base:0},{id:"minecraft:follow_range",base:48},{id:"minecraft:knockback_resistance",base:1}]}

#set id for stuff
scoreboard players set @e[type=interaction,tag=id27_mob,tag=newborn,limit=1] id 27

##set level, health and id for newborn enemy
#set health
$scoreboard players set @e[type=interaction,tag=id27_mob,tag=newborn,limit=1] health_max $(health)
$scoreboard players add @e[type=interaction,tag=id27_mob,tag=newborn,limit=1] health $(health)

execute as @e[type=interaction,tag=id27_mob,tag=newborn] run function main:game/mobs/spawn/scores

#enemy is not newborn now
tag @e[type=interaction,tag=id27_mob,tag=newborn,limit=1] remove newborn

schedule function main:game/mobs/ai/id/id27/schedule 5s