-
Bug
-
Resolution: Invalid
-
None
-
1.19.50.21 Preview
-
None
-
Unconfirmed
-
Multiple
The changelog for preview 1.19.50.20 at Minecraft Beta & Preview - 1.19.50.20 – Minecraft Feedback states the following:
- Entity
- Removed function runCommand. Consider runCommandAsync as an alternative
- Dimension
- Removed function runCommand. Consider runCommandAsync as an alternative
runCommand previously returned different results depending on the command being executed. In some cases we can get statusCode and statusMessage. Yet runCommandAsync returns Promise<CommandResult> which only ever has a successCount.
So for example, when I do this in 1.19.30 :-
const msg = p.runCommand(`locate biome swampland`);
let code = parseInt(msg.statusCode);
let message: string = msg.statusMessage;
I will get a numeric code (0 == success) and the message will be the same as is usually printed in the player chat as if you ran the same command manually.
I cannot get the same results by using runCommandAsync() as I always get a Promise<CommandResult> and CommandResult has one property, that being successCount.
I was hoping to use the locate command from my script to find a biome then teleport to it but it looks as though I will not be able to parse the location from the statusMessage in the upcoming versions?
The documentation for runCommandAsync states "For commands that return data, returns a JSON structure with command response values." but this doesn't seem to be true?