export function onHitEntity(event) {
    const { attackingEntity, hadEffect, hitEntity, itemStack } = event;

    try {
        // Get the position of the hit entity
        const hitPosition = hitEntity.location; // Correct method to retrieve position

        // Summon a lightning bolt at the hit entity's location
        hitEntity.runCommand(`playsound ambient.weather.lightning.impact @a ~~~ 0.25 0.5 0.01`);
        hitEntity.runCommand(`playsound ambient.weather.lightning.impact @a ~~~ 0.125 1 0.01`);
        hitEntity.runCommand(`particle lv_mo:lightning_strike ~~~`);

    } catch (error) {
    }
}

const neptunes_trident = {
    onHitEntity: onHitEntity,
};

export default neptunes_trident;
