tellraw @a[team=P] ["",{"text":"Jockey!","color":"dark_red","italic":true}]


#tag the mobs to be replaced
tag @e[tag=K,type=zombie] add KyuJockeyReplace
tag @e[tag=K,type=skeleton] add KyuJockeyReplace
tag @e[tag=K,type=zombified_piglin] add KyuJockeyReplace
tag @e[tag=K,type=creeper] add KyuJockeyReplace
tag @e[tag=K,type=enderman] add KyuJockeyReplace
tag @e[tag=K,type=spider] add KyuJockeyReplace
tag @e[tag=K,type=cave_spider] add KyuJockeyReplace
tag @e[tag=K,type=stray,name=!"Cadeyrn the Wretched",tag=!CadeyrnTP] add KyuJockeyReplace
tag @e[tag=K,type=husk] add KyuJockeyReplace
tag @e[tag=K,type=blaze] add KyuJockeyReplace
tag @e[tag=K,type=wither_skeleton] add KyuJockeyReplace
tag @e[tag=K,type=phantom] add KyuJockeyReplace



execute as @e[tag=KyuJockeyReplace] run execute at @s run function zzzzdonotuse:randomevent/jockey/jockeyattributes
execute as @e[tag=KyuJockeyMob] run execute at @s run function zzzzdonotuse:randomevent/jockey/jockeyattributes2




#send the old mobs to the void
execute as @e[tag=KyuJockeyReplace,tag=!KyuJockeyMob] run execute at @s run tp @s ~ ~-500 ~