[SPIGOT-3748] Disabled plugin's commands dont't react Created: 08/Jan/18  Updated: 08/Jan/18  Resolved: 08/Jan/18

Status: Resolved
Project: Spigot
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Minor
Reporter: Selebrator Assignee: Unassigned
Resolution: Fixed Votes: 0
Labels: Bukkit, NoOutput, commands, diasbled, disable, plugin

Attachments: File DisabledCommandExecutor.jar    

 Description   

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.


Generated at Sun Mar 30 18:01:22 UTC 2025 using Jira 10.3.3#10030003-sha1:d220e3fefc8dfc6d47f522d3b9a20c1455e12b7b.