export function onHitEntity(event) {
    const { attackingEntity, hadEffect, hitEntity, itemStack } = event;
    try {
        // Apply instant damage effect to the hit entity
        hitEntity.addEffect('fatal_poison', (2 * 20), { amplifier: 0, showParticles: false });
        hitEntity.runCommand(`/particle lv_mo:void_hit ~~0.5~`);

        attackingEntity.addEffect('regeneration', (1 * 20), { amplifier: 3, showParticles: false });
    } catch (error) {
    }
}

const void_sword = {
    onHitEntity: onHitEntity,
};
export default void_sword;
