NPCs included, finishing touches zijn nog nodig

This commit is contained in:
2024-09-11 16:54:16 +02:00
parent 283f95e00a
commit c323e98bcd
25 changed files with 1665 additions and 891 deletions

View File

@@ -1,5 +1,6 @@
import { BlockType, BlockTypes, BlockVolume, Vector3, world } from "@minecraft/server";
import { MinecraftBlockTypes } from "../../vanilla-data/mojang-block";
import { vector3 } from "./vectorUtils";
type Wall = {
startPos: Vector3;
@@ -20,5 +21,19 @@ function startLevel(commandBlockPos: Vector3) {
let volume: BlockVolume = new BlockVolume(commandBlockPos, commandBlockPos);
world.getDimension("overworld").fillBlocks(volume, MinecraftBlockTypes.RedstoneBlock);
}
function teleportAndFaceAgent(position: Vector3, facing: Vector3 = vector3(0, 0, 0)): void {
world
.getDimension("overworld")
.runCommand(
`/execute as @a run tp @e[type=agent] ${position.x} ${position.y} ${position.z} facing ${facing.x} ${facing.y} ${facing.z}`
);
}
function placeBlock(position: Vector3, blockType: MinecraftBlockTypes) {
const block = world.getDimension("overworld").getBlock(position);
block!.setType(blockType);
}
BlockTypes;
export { Wall, clearWall, fillWall, startLevel };
export { Wall, clearWall, fillWall, startLevel, teleportAndFaceAgent, placeBlock };