get_allcommands()
LadyCailinBot opened this issue ยท 2 comments
CMDHELPER-3035 - Reported by janwil
Feature request for a commandhelper command that shows all commands registered in minecraft ( commandhelper and bukkit). Addition to the reflect items
Something like: get_aliases but than get_allregisteredcommands or something
Comment by janwil
i found this on the internet: http://stackoverflow.com/questions/24217780/when-using-bukkit-api-how-to-access-all-commands-in-a-server. Has to be run after everything else is registered
// create the List to store command names into
List<String> commandNames = new ArrayList<String>();
// loop through all of the helpTopics, a list of all commands displayed
// in /help (therefore all of the commands)
for(HelpTopic cmd : plugin.getServer().getHelpMap().getHelpTopics()){
commandNames.add(cmd.getName());//add the name of the command to the Array
}