Add Formatting (Thank God)

This commit is contained in:
2024-08-29 15:47:58 +02:00
parent 545e47a9f3
commit 1ab45204b9
35 changed files with 2331 additions and 254 deletions

View File

@@ -1,17 +1,15 @@
import { Entity, Vector3, world } from "@minecraft/server";
import { Vector3Add, Vector3ToString, vector3 } from "./vectorUtils";
import { Vector3Add, vector3 } from "./vectorUtils";
import { mindKeeper } from "../../main";
//Make a facing with vector3
type Facing = Vector3;
function teleportAgent(position: Vector3, facing: Vector3 = vector3(0, 0, 0)): void {
if (facing == vector3(0, 0, 0)) {
world
.getDimension("overworld")
.runCommand(`/execute as @a run tp @e[type=agent] ${position.x} ${position.y} ${position.z}`);
} else {
let facing2 = Vector3Add(position, facing);
const facing2 = Vector3Add(position, facing);
world
.getDimension("overworld")
.runCommand(
@@ -38,13 +36,13 @@ function isAgentAt(position: Vector3): boolean {
}
function getAgent(): Entity {
let agent = world.getEntity(mindKeeper.get("agentid") as string);
const agent = world.getEntity(mindKeeper.get("agentid") as string);
return agent!;
}
function getAgentLocation(): Vector3 {
let agentLocation: Vector3 = vector3(0, 0, 0);
let agent = world.getEntity(mindKeeper.get("agentid") as string);
const agent = world.getEntity(mindKeeper.get("agentid") as string);
agentLocation = agent!.location;
return agentLocation;