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

function cosmicCreeperEffects(event) {
    const { hurtEntity, damageSource } = event;

    if (damageSource.damagingEntity?.typeId !== "sapphire_meteors:cosmic_creeper") return;

    ["slow_falling", "jump_boost"].forEach(effect => {
        hurtEntity.addEffect(effect, 200, { amplifier: 2, showParticles: false });
    });
};

world.afterEvents.entityHurt.subscribe((event) => {
    cosmicCreeperEffects(event);
});