import * as mc from "@minecraft/server";
import { SafetyCheckedPlayer } from "../utils/index";
import { knockBackEntity } from "../local_utils";
export function initCamelWeapon() {
    mc.system.afterEvents.scriptEventReceive.subscribe(event => {
        if (event.id === "ldz:camel_dash" && event.sourceEntity && event.sourceEntity.typeId === "minecraft:player") {
            const player = new SafetyCheckedPlayer(event.sourceEntity);
            knockBackEntity(player, player.getViewDirection(), 2.5, 0.5);
            player.triggerEvent("add_camel_dashing");
            player.triggerEvent("add_invulnerability");
            mc.world.playSound("weapon.camel.slice", player.location);
        }
    });
}
