Uploaded image for project: 'Spigot'
  1. Spigot
  2. SPIGOT-3748

Disabled plugin's commands dont't react

XMLWordPrintable

      When a plugin that has commands get's disabled it's commands stay, but dont do anything.
      They remain listed in /help and dont give a "Unknown command" message when executed.

      I made a plugin for testing: DisabledCommandExecutor.jar
      MainCalss

      import org.bukkit.Bukkit;
      import org.bukkit.command.*;
      import org.bukkit.plugin.java.JavaPlugin;
      
      public class DisabledCommandExecutorPlugin extends JavaPlugin implements CommandExecutor {
      
      	@Override
      	public void onEnable() {
      		this.getCommand("killme").setExecutor(this);
      	}
      
      	@Override
      	public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
      		sender.sendMessage("Working :)");
      		Bukkit.getPluginManager().disablePlugin(this);
      		return true;
      	}
      }
      
      

      plugin.yml

      name: DisabledCommandExecutor
      version: 1.0.0
      main: DisabledCommandExecutorPlugin
      commands:
        killme:

      Executing /doanything results (as expected) in

      Unknown command. Type "/help" for help.
      

      Executing /killme gives (as expected)

      Working :)
      [DisabledCommandExecutor] Disabling DisabledCommandExecutor v1.0.0
      

      But executing /killme a second time gives no output at all. This is frustrating for the user because they may not notice that a plugin was disabled and then don't get any feedback why their commands are not working.
      I suggest to make commands from disabled plugins act the same as unknown commands.

            Unassigned Unassigned
            Selebrator Selebrator
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: