I'd love to have the possibility to create custom commands via the Scripting API.
It would be very nice to also have the ability to handle the result of build in commands for better administration.
This would make live so much easier!
Possibly like that:
system.initialize = function () {
const CPT_INT = 1;
const CPT_STRING = 1;
const param1 = this.registerCommandParameter("param1", CPT_INT, false /* Optional */);
const param2 = this.registerCommandParameter("param2", CPT_STRING, true /* Optional */);
this.registerCommand("name", "description", [param1, param2]);
this.listenForEvent("minecraft:commandExecuted", (eventData) => {
let id = eventData.data.__identifier__; // name
let player = eventData.data.player; // player, who called command or null if command block
eventData.success = false;
eventData.output = "Some Text";
});
}
Please sign in to leave a comment.
0 Comments