This commit is contained in:
2024-08-05 10:12:32 +02:00
parent ba384d79d8
commit 61c5a0e489
20 changed files with 1035 additions and 189 deletions

View File

@@ -1,5 +1,6 @@
import { MinecraftEntityTypes, Vector3, world } from "@minecraft/server";
import { Entity, MinecraftEntityTypes, Vector3, world } from "@minecraft/server";
import { Vector3ToString, vector3 } from "./vectorUtils";
import { mindKeeper } from "../../main";
function teleportAgent(position: Vector3) {
world
.getDimension("overworld")
@@ -23,12 +24,17 @@ function isAgentAt(position: Vector3): boolean {
return isAgentAt;
}
function getAgent(): Entity {
let 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);
// agentLocation = agent!.location;
let agent = world.getEntity(mindKeeper.get("agentid") as string);
agentLocation = agent!.location;
return agentLocation;
}
export { teleportAgent, isAgentAt, getAgentLocation };
export { teleportAgent, isAgentAt, getAgentLocation, getAgent };