
import { Knockback } from "../../utils/Knockback.js";
import { GetRandomInt } from "../../utils/GetRandomInt.js";
import { sleep } from "../../utils/sleep.js";

export async function Bogstrider(hitEntity, damagingEntity) {
    if (damagingEntity.typeId === 'lv_mo:bogstrider') {
        const knockbackMagnitude = GetRandomInt(8, 12);
        const knockback = Knockback.knockbackPosition(damagingEntity.location, hitEntity.location, knockbackMagnitude);
        await sleep(1)
        hitEntity.applyKnockback(knockback.x, knockback.z, 4.3, 0.5);
    }
}
