Add Alot
This commit is contained in:
@@ -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 };
|
||||
|
||||
@@ -218,9 +218,10 @@ function spawnParticle(
|
||||
) {
|
||||
//check if the chunk is loaded
|
||||
const chunk = world.getDimension("overworld").getBlock(position);
|
||||
if (!chunk?.isValid) {
|
||||
if (!chunk?.isValid()) {
|
||||
return;
|
||||
}
|
||||
map.setVector3("variable.direction", vector3(0, 0, 0));
|
||||
|
||||
const dimension = world.getDimension("overworld");
|
||||
if (dimension) {
|
||||
|
||||
Reference in New Issue
Block a user