import { world } from "@minecraft/server";
import { Vector3 }  from "./vector3.js";

export function launchPlayer(player, launch_power, upwards) {
    player.applyKnockback(player.getViewDirection().x, player.getViewDirection().z, launch_power, upwards)
}

export function teleporter(player, distance) {
    let pos = Vector3.Add(player.location, Vector3.Scale(player.getViewDirection(), distance));
    //player.runCommand(`execute as @s run teleport @s ${pos}`)
    player.tryTeleport(pos, {checkForBlocks: true,});
}