NPCs included, finishing touches zijn nog nodig
This commit is contained in:
@@ -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 };
|
||||
|
||||
Reference in New Issue
Block a user