import { world } from "@minecraft/server";
import { spawnItemForDeath } from "../C/SpawnItem";
import { mountDeathIds } from "../DATA/Config";
export function runEntityDieAfterEvent(log) {
    world.afterEvents.entityDie.subscribe((event) => {
        const deadEntity = event.deadEntity;
        if (!deadEntity)
            return;
        try {
            const entityId = deadEntity.typeId;
            const entityDimension = deadEntity.dimension;
            const entityLocation = deadEntity.location;
            const entityIsWild = deadEntity.getProperty("kicu_mmad:is_wild");
            if (mountDeathIds.includes(entityId)) {
                spawnItemForDeath(entityId, entityDimension, entityLocation, entityIsWild.valueOf(), log);
            }
        }
        catch { }
    });
}

//# sourceMappingURL=../../../../../_KiCuMountsBPDebug/kicu/mmad/ESS/EntityDieEvent.js.map
