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

// Soul Weapons

const soulWeapons = [
    'dungeons:soul_scythe',
    'dungeons:soul_knife',
    'dungeons:truthseeker',
    'dungeons:eternal_knife',
    'dungeons:frozen_scythe',
    'dungeons:jailors_scythe'
];

// Soul Collection

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

    if (!damageSource) { return; }
    if (damageSource.typeId === "minecraft:player" && (deadEntity.matches({families: ['monster'] }) || deadEntity.matches({families: ['mob'] }) )) {
            deadEntity.runCommandAsync('particle dungeons:soul2 ~~~')
    }
});