1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

How to replace /help in Bukkit plugin development?

Discussion in 'Software/Coding' started by olsyboy, Jul 15, 2015.

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

    olsyboy Member

    Joined:
    Jun 13, 2015
    Messages:
    215
    Likes Received:
    56
    Trophy Points:
    28
    Gender:
    Male
    Occupation:
    Student
    I want a new /help page, mainly to make it easier to change this page between OPs and members,

    thanks
     
  2. alyphen

    alyphen Member

    Joined:
    Jan 4, 2014
    Messages:
    101
    Likes Received:
    96
    Trophy Points:
    28
    Gender:
    Male
    Occupation:
    Technical Consultant
    Location:
    127.0.0.1
    Home Page:
    If you simply want to override it, stick help as a command in your plugin.yml as you usually would, and add a HelpCommand class that implements CommandExecutor. Then just call getCommand("help").setExecutor(new HelpCommand()); from your onEnable method and override the onCommand method in your HelpCommand class - then you can give it any behaviour you want. Plugins are prioritised over Bukkit & Vanilla commands where they exist.
     
  3. olsyboy

    olsyboy Member

    Joined:
    Jun 13, 2015
    Messages:
    215
    Likes Received:
    56
    Trophy Points:
    28
    Gender:
    Male
    Occupation:
    Student
    Ah, thanks!
     
Thread Status:
Not open for further replies.