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
34 lines (30 loc) · 1020 Bytes
/
index.js
File metadata and controls
34 lines (30 loc) · 1020 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
// Script example for ScriptAPI
// Author: JaylyDev <https://github.com/JaylyDev>
// Project: https://github.com/JaylyDev/ScriptAPI
import { world, system, BlockPermutation } from "@minecraft/server";
import { MinecraftBlockTypes } from "@minecraft/vanilla-data";
const commandBlocks = [
MinecraftBlockTypes.CommandBlock,
MinecraftBlockTypes.ChainCommandBlock,
MinecraftBlockTypes.RepeatingCommandBlock
];
function DeleteCommandBlocks () {
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.dimension.fillBlocks({
x: x - 15,
y: y,
z: z - 15,
}, {
x: x + 16,
y: y + 31,
z: z + 16,
}, MinecraftBlockTypes.Air, { matchingBlock: BlockPermutation.resolve(commandBlock) });
}
};
};
};
system.runInterval(DeleteCommandBlocks);