scoreboard objectives add susg dummy susg
scoreboard players random @s susg 1 6
clear @s zc:sus_gift 0 1
execute @a[scores={susg=1..3}] ~~~ loot spawn ^^^2 loot "entities/zc_int"

execute @a[scores={susg=1}] ~~~ playsound random.totem @s ~~~ 1 0.6
execute @a[scores={susg=2}] ~~~ playsound armor.equip_iron @s ~~~ 1 0.6
execute @a[scores={susg=3}] ~~~ playsound block.bell.hit @s ~~~ 1 0.6



 execute @a[scores={susg=4}] ~~~ summon breeze Windy Whiz
execute @a[scores={susg=4}] ~~~ playsound mob.ghast.scream @s ~~~ 1 0.6

execute @a[scores={susg=5}] ~~~ summon blaze Spicy Torch 
execute @a[scores={susg=5}] ~~~ playsound mob.witch.celebrate @s ~~~ 1 0.6


execute @a[scores={susg=6}] ~~~ summon vex Angry Fairy 
execute @a[scores={susg=6}] ~~~ summon vex Angry Fairy 
execute @a[scores={susg=6}] ~~~ summon vex Angry Fairy 
execute @a[scores={susg=6}] ~~~ playsound mob.evocation_illager.prepare_wololo @s ~~~ 1 0.6



import { world } from "@minecraft/server";

world.afterEvents.entityDie.subscribe((event) => {
  const entity = event.deadEntity;

  try {
    const { x, y, z } = entity.location;
    entity.dimension.runCommandAsync(`loot spawn ${x} ${y} ${z} loot "entities/zc_single`);
  } catch (error) {
    console.error(`Failed to summon fireworks: ${error}`);
  }
});