tellraw @a[tag=K] ["",{"text":"A random event has occured!","color":"yellow","italic":true}]
tellraw @a[tag=K] ["",{"text":"Everything is terrible...","color":"dark_red","italic":true}]

#execute as @e[tag=K,type=skeleton] run execute at @s run loot spawn ~ ~ ~ loot minecraft:randomevents/champyskelly
#execute as @e[tag=K,type=skeleton] run execute at @s run execute if entity @e[distance=..1,nbt={Item:{tag:{display:{Lore:["\"PoiSkel\""]}}}}] run function zzzzdonotuse:specialskele/poisonskele
#execute as @e[tag=K,type=skeleton] run execute at @s run execute if entity @e[distance=..1,nbt={Item:{tag:{display:{Lore:["\"BliSkel\""]}}}}] run function zzzzdonotuse:specialskele/blindskele
#execute as @e[tag=K,type=skeleton] run execute at @s run execute if entity @e[distance=..1,nbt={Item:{tag:{display:{Lore:["\"LeviSkel\""]}}}}] run function zzzzdonotuse:specialskele/leviskele
#execute as @e[tag=K,type=skeleton] run execute at @s run execute if entity @e[distance=..1,nbt={Item:{tag:{display:{Lore:["\"DamSkel\""]}}}}] run function zzzzdonotuse:specialskele/damskele
#execute as @e[tag=K,type=skeleton] run execute at @s run execute if entity @e[distance=..1,nbt={Item:{tag:{display:{Lore:["\"WeakSkel\""]}}}}] run function zzzzdonotuse:specialskele/weakskele
#execute as @e[tag=K,type=skeleton] run execute at @s run execute if entity @e[distance=..1,nbt={Item:{tag:{display:{Lore:["\"WithSkel\""]}}}}] run function zzzzdonotuse:specialskele/withskele
#execute as @e[tag=K,type=skeleton] run execute at @s run execute if entity @e[distance=..1,nbt={Item:{tag:{display:{Lore:["\"KnockSkel\""]}}}}] run function zzzzdonotuse:specialskele/knockskele
#execute as @e[tag=K,type=skeleton] run execute at @s run execute if entity @e[distance=..1,nbt={Item:{tag:{display:{Lore:["\"FireSkel\""]}}}}] run function zzzzdonotuse:specialskele/fireskele
#execute as @e[tag=K,type=skeleton] run data merge entity @s {Tags:["RemovePersist"],PersistenceRequired:1}
#execute at @e[tag=K,type=skeleton] run kill @e[type=item,nbt={Item:{tag:{killmeitem:1b}}},distance=..2]

execute as @e[type=skeleton] run function zzzzdonotuse:champions/skeletontypes/chooseskeletontype
execute as @e[type=creeper] run function zzzzdonotuse:champions/creepertypes/choosecreepertype
execute as @e[type=#suhc:zombietype] run function zzzzdonotuse:champions/zombietypes/choosezombietype
execute as @e[type=spider] run function zzzzdonotuse:champions/spidertypes/choosespidertype

execute as @e[type=skeleton] run data merge entity @s {PersistenceRequired:1b}
execute as @e[type=creeper] run data merge entity @s {PersistenceRequired:1b}
execute as @e[type=#suhc:zombietype] run data merge entity @s {PersistenceRequired:1b}
execute as @e[type=spider] run data merge entity @s {PersistenceRequired:1b}

execute as @e[type=skeleton] run tag @s add RemovePersist
execute as @e[type=creeper] run tag @s add RemovePersist
execute as @e[type=#suhc:zombietype] run tag @s add RemovePersist
execute as @e[type=spider] run tag @s add RemovePersist


execute as @e[type=skeleton] run scoreboard players set @s DespawnTimerKyu 5
execute as @e[type=creeper] run scoreboard players set @s DespawnTimerKyu 5
execute as @e[type=#suhc:zombietype] run scoreboard players set @s DespawnTimerKyu 5
execute as @e[type=spider] run scoreboard players set @s DespawnTimerKyu 5
