import { system, TicksPerSecond } from "@minecraft/server";
import { cockatriceArmorConfig } from "../DATA/ArmorConfig";
export function knockbackNearbyEnemies(log, player, entity) {
    try {
        if (entity) {
            player.playSound(cockatriceArmorConfig.soundEffect.sound, {
                pitch: cockatriceArmorConfig.soundEffect.pitch,
                volume: cockatriceArmorConfig.soundEffect.volume,
            });
            system.runTimeout(() => {
                const playerToEntityVector = {
                    x: entity.location.x - player.location.x,
                    y: entity.location.y - player.location.y,
                    z: entity.location.z - player.location.z,
                };
                entity.applyKnockback(playerToEntityVector.x, playerToEntityVector.z, cockatriceArmorConfig.horizontalStrength, cockatriceArmorConfig.verticalStrength);
                const runInt = system.runInterval(() => {
                    entity.dimension.spawnParticle("kicu_mmad:cockatrice_airburst_particle2", entity.location);
                }, 1);
                system.runTimeout(() => {
                    system.clearRun(runInt);
                }, cockatriceArmorConfig.endKnockbackDelay * TicksPerSecond);
            }, cockatriceArmorConfig.startKnockbackDelay * TicksPerSecond);
        }
    }
    catch { }
}

//# sourceMappingURL=../../../../../_KiCuMountsBPDebug/kicu/mmad/A/CockatriceArmour.js.map
