Making a /help command?

Discussion in 'Plugin Development' started by Aephout14, Mar 19, 2015.

Thread Status:
Not open for further replies.
  1. Offline

    Aephout14

    I would like to know how i would make a /help command and display the commands you have access to, Any help?

    Thanks In Advance!
     
  2. Offline

    Faith

    So you want to display a custom message determined by the sender's permissions?
     
  3. Offline

    Aephout14

    @Faith I want It the way Essentials has it.
     
  4. Offline

    Faith

    So why can't you use Essentials?
     
  5. Offline

    Aephout14

    @Faith I am making a custom plugin thats why.
     
  6. Offline

    Faith

    So you want a plugin which does the exact same thing Essentials does for the /help command?
     
  7. @Faith I think @The_FrosTy_Clan is saying that he wants to make his own /help command. You can override the default /help command by making one yourself. The only way it couldn't work is if you have multiple plugins with the same command or you aren't regostering your commands via plugin.yml.
     
  8. Offline

    Faith

  9. Offline

    mttprvst13

    To make it like essentials, essentials finds all of the commands and their permissions. Then it does something like:
    Code:
    Player player = (Player) sender;
    String help = "Essentials help\n";
    for(Command c : getAllCommands()){
    
        if(player.hasPermission(c.getPermission()){
           
            help = help + c.getCommand() + " - " + c.getDescription() + "\n";
    
        }
    
    }
    player.sendMessage(help);
    return false;
    
    of course you would have to make those functions and personalize it the way you want, but thats basicaly the jist of it.
     
  10. A much easier way todo this is to edit some of essentials messages, if you play around with the folder you can edit almost ALL of the messages. And follow this if you want to edit the command messages: http://ess.khhq.net/wiki/Locale#Custom_Messages
     
Thread Status:
Not open for further replies.

Share This Page