scoreboard players set @s KyuDummy 0

tag @s remove BulletAttack
tag @s remove MobAttack
tag @s remove CorruptAttack
tag @s remove LevitateAttack
tag @s add DoAttack

#summon a marker, and generate a number between 0-3 to determine the mechanic
summon marker ~ ~ ~ {Tags:["CorruptShulkerMechanic"]}
execute at @s run execute store result score @e[type=marker,distance=..1,tag=CorruptShulkerMechanic,limit=1,sort=nearest] KyuDummy run data get entity @e[type=marker,distance=..1,tag=CorruptShulkerMechanic,limit=1,sort=nearest] UUID[0] .1
scoreboard players set @e[type=marker,distance=..1,tag=CorruptShulkerMechanic,limit=1,sort=nearest] KyuDummy2 4
scoreboard players operation @e[type=marker,distance=..1,tag=CorruptShulkerMechanic,limit=1,sort=nearest] KyuDummy %= @e[type=marker,distance=..1,tag=CorruptShulkerMechanic,limit=1,sort=nearest] KyuDummy2

#60% chance to spawn 1 mob, 30% chance to spawn 2 mobs, 10% chance to spawn 3 mobs
execute at @s run execute if entity @e[type=marker,tag=CorruptShulkerMechanic,limit=1,sort=nearest,distance=..2,scores={KyuDummy=0}] run tag @s add BulletAttack
execute at @s run execute if entity @e[type=marker,tag=CorruptShulkerMechanic,limit=1,sort=nearest,distance=..2,scores={KyuDummy=1}] run tag @s add MobAttack
execute at @s run execute if entity @e[type=marker,tag=CorruptShulkerMechanic,limit=1,sort=nearest,distance=..2,scores={KyuDummy=2}] run tag @s add CorruptAttack
execute at @s run execute if entity @e[type=marker,tag=CorruptShulkerMechanic,limit=1,sort=nearest,distance=..2,scores={KyuDummy=3}] run tag @s add LevitateAttack

execute at @s run kill @e[type=marker,distance=..1,sort=nearest,tag=CorruptShulkerMechanic]
