##ID 8

#summon id8_mob x and y are random values
summon zombie ~ ~1 ~ {PersistenceRequired:1b,attributes:[{id:"minecraft:step_height",base:1},{id:"minecraft:follow_range",base:50}],ArmorItems:[{},{},{},{components:{"minecraft:custom_data":{enemy_drop:1b},"minecraft:profile":{id:[I;1286809112,-1121893785,-1834820193,935237806],name:"",properties:[{name:"textures",value:"eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvYzg4YWQzNTQ0YzJhOGEwZGE1Nzc0MTJkNjFkMGExMjEyOWJkZDc0MThkMjdjZTc3MDE4MjZkYTg4NzJhN2JiMyJ9fX0="}]}},count:1,id:"minecraft:player_head"}],CanPickUpLoot:0b,CustomName:'{"text":"Ghost","color":"aqua"}',Health:1000.0f,Tags:["id8_mob","enemy","newborn","minion"],active_effects:[{amplifier:1b,duration:1999980,id:"minecraft:invisibility",show_particles:0b}],attributes:[{base:1000,id:"max_health"},{base:10000,id:"armor"},{base:10000,id:"armor_toughness"}]}



#set id for stuff
scoreboard players set @e[type=zombie,tag=id8_mob,tag=newborn,limit=1] id 8

##set level, health and id for newborn enemy
#set health
scoreboard players set @e[type=zombie,tag=id8_mob,tag=newborn,limit=1] health_max 200
scoreboard players add @e[type=zombie,tag=id8_mob,tag=newborn,limit=1] health 200

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

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