removeCommand

Remove any command with a script.

Overview:

Functions:

API Reference

removeCommand()

Removes the specified command if it exists

removeCommand("commandName");

Parameters:

  • commandName (String) The name of the command (without /)


Example:

Removing a Minecraft command and overwriting it with a custom one
removeCommand("help");
addCommand("help", {
    onCommand: function(sender, args) {
        sender.sendMessage("Hello from help!");
    },
    onTabComplete: function(sender, args) {
        return toJavaList(["Example", "Custom"]);
    }
});

Last updated

Was this helpful?