Skip to content

Commit 06103f0

Browse files
committed
2 parents 996d0c2 + 5680bb4 commit 06103f0

1 file changed

Lines changed: 17 additions & 3 deletions

File tree

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)