forked from JaylyDev/ScriptAPI
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
21 lines (17 loc) · 800 Bytes
/
index.js
File metadata and controls
21 lines (17 loc) · 800 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// Script example for ScriptAPI
// Author: JaylyDev <https://github.com/JaylyDev>
// Project: https://github.com/JaylyDev/ScriptAPI
import { world, MinecraftBlockTypes, system } from "@minecraft/server";
async function DeleteCommandBlocks () {
let CommandBlocks = MinecraftBlockTypes.getAllBlockTypes().filter(blockType => blockType.id.endsWith("command_block"));
for (const player of world.getPlayers()) {
for (let CommandBlock of CommandBlocks) {
for (let index = 0; index < (384 / 32); index++) {
const { x, z } = player.location;
const y = index * 32 - 64;
player.runCommandAsync(`fill ${x - 15} ${y} ${z - 15} ${x + 16} ${y + 31} ${z + 16} air 0 replace ${CommandBlock.id}`);
}
};
};
};
system.runInterval(DeleteCommandBlocks);