Skip to content

Commit 5680bb4

Browse files
authored
1 parent dbf75d8 commit 5680bb4

File tree

1 file changed

+17
-3
lines changed

1 file changed

+17
-3
lines changed

scripts/run-command-async/index.js

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,21 @@
11
import { Dimension, Player, Entity } from "mojang-minecraft";
22

3-
Dimension.prototype.runCommandAsync = async (commandString) => this.runCommand(await commandString);
3+
export class CommandResult {
4+
'successCount' = 1;
5+
constructor() {};
6+
};
47

5-
Player.prototype.runCommandAsync = async (commandString) => this.runCommand(await commandString);
8+
Dimension.prototype.runCommandAsync = async function (commandString) {
9+
this.runCommand(await commandString);
10+
return new CommandResult();
11+
};
612

7-
Entity.prototype.runCommandAsync = async (commandString) => this.runCommand(await commandString);
13+
Player.prototype.runCommandAsync = async function (commandString) {
14+
this.runCommand(await commandString);
15+
return new CommandResult();
16+
};
17+
18+
Entity.prototype.runCommandAsync = async function (commandString) {
19+
this.runCommand(await commandString);
20+
return new CommandResult();
21+
};

0 commit comments

Comments
 (0)