scoreboard players add @e[distance=..3,type=marker,tag=CacklingCreeperEvent] KyuDummy 1
scoreboard players add @e[distance=..3,type=marker,tag=CacklingCreeperEvent] KyuDummy2 1
#every 74 ticks, replace all mobs
execute as @e[distance=..3,type=marker,tag=CacklingCreeperEvent,scores={KyuDummy2=74..}] run execute as @s[scores={KyuDummy=..3600}] run function zzzzdonotuse:randomevent/cacklingcreepers/cacklingcreepersreplacemob

#after 3 minutes has passed, slowly get rid of most creepers spawned by the event
execute if entity @e[distance=..3,type=marker,tag=CacklingCreeperEvent,scores={KyuDummy=3600}] run execute as @e[type=creeper,tag=CackleCreeper] run execute if predicate suhc:10percent run execute at @s run tp @s ~ ~-500 ~
execute if entity @e[distance=..3,type=marker,tag=CacklingCreeperEvent,scores={KyuDummy=3800}] run execute as @e[type=creeper,tag=CackleCreeper] run execute if predicate suhc:10percent run execute at @s run tp @s ~ ~-500 ~
execute if entity @e[distance=..3,type=marker,tag=CacklingCreeperEvent,scores={KyuDummy=4000}] run execute as @e[type=creeper,tag=CackleCreeper] run execute if predicate suhc:25percent run execute at @s run tp @s ~ ~-500 ~
execute if entity @e[distance=..3,type=marker,tag=CacklingCreeperEvent,scores={KyuDummy=4200}] run execute as @e[type=creeper,tag=CackleCreeper] run execute if predicate suhc:25percent run execute at @s run tp @s ~ ~-500 ~
execute if entity @e[distance=..3,type=marker,tag=CacklingCreeperEvent,scores={KyuDummy=4400}] run execute as @e[type=creeper,tag=CackleCreeper] run execute if predicate suhc:25percent run execute at @s run tp @s ~ ~-500 ~
execute if entity @e[distance=..3,type=marker,tag=CacklingCreeperEvent,scores={KyuDummy=4600}] run execute as @e[type=creeper,tag=CackleCreeper] run execute if predicate suhc:50percent run execute at @s run tp @s ~ ~-500 ~
execute if entity @e[distance=..3,type=marker,tag=CacklingCreeperEvent,scores={KyuDummy=4800}] run execute as @e[type=creeper,tag=CackleCreeper] run execute if predicate suhc:50percent run execute at @s run tp @s ~ ~-500 ~



#reset
execute if entity @e[distance=..3,type=marker,tag=CacklingCreeperEvent,scores={KyuDummy=4800..}] run execute in overworld run data merge block 999982 128 999979 {auto:0b}
execute if entity @e[distance=..3,type=marker,tag=CacklingCreeperEvent,scores={KyuDummy=4800..}] run kill @e[distance=..3,type=marker,tag=CacklingCreeperEvent,scores={KyuDummy=4800..}]

#cackle
execute if entity @e[distance=..3,type=marker,tag=CacklingCreeperEvent,scores={KyuDummy=..4800}] run execute at @e[type=creeper,tag=CackleCreeper] run execute if predicate suhc:25percent run execute if predicate suhc:10percent run playsound minecraft:entity.witch.celebrate hostile @a[distance=..25] ~ ~ ~ 1 2


execute unless entity @e[distance=..3,type=marker,tag=CacklingCreeperEvent] run execute in overworld run data merge block 999982 128 999979 {auto:0b}
