Files
Reeks2Missie6/scripts/Commandeer/utils/levelUtils.ts
2024-08-05 12:06:10 +02:00

23 lines
747 B
TypeScript

import { BlockType, BlockVolume, MinecraftBlockTypes, Vector3, world } from "@minecraft/server";
type Wall = {
startPos: Vector3;
endPos: Vector3;
};
function clearWall(wall: Wall) {
let volume: BlockVolume = new BlockVolume(wall.startPos, wall.endPos);
world.getDimension("overworld").fillBlocks(volume, MinecraftBlockTypes.air);
}
function fillWall(wall: Wall, block: BlockType) {
let volume: BlockVolume = new BlockVolume(wall.startPos, wall.endPos);
world.getDimension("overworld").fillBlocks(volume, block);
}
function startLevel(commandBlockPos: Vector3) {
world.getDimension("overworld").fillBlocks(commandBlockPos, commandBlockPos, MinecraftBlockTypes.redstoneBlock);
}
export { Wall, clearWall, fillWall, startLevel };