Plugin Development Help!

Discussion in 'Plugin Development' started by Aephout14, Oct 30, 2014.

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

    Aephout14

    Alright so, The title pretty much says it all.

    I have no clue how to do this but, For a plugin i was wondering how to create a /help command that list all the commands of the plugin and other plugins.
     
  2. Offline

    es359

    Ehh... /help <section> lol...?
     
  3. Offline

    Watto

  4. Offline

    Aephout14

  5. Offline

    OffLuffy

    I didn't think Bukkit did, but rather Essentials does
     
    es359 likes this.
  6. Offline

    Watto

  7. Offline

    Aephout14

    OffLuffy Do you know how i can make my own help command, that doesn't require essentials?
     
  8. Offline

    fireblast709

    OffLuffy likes this.
  9. Offline

    Aephout14

    fireblast709 I meant a way like, If you do /help on essentials, It displays commands and a nice feature like

    ------------------------
    Command1 Description



    -----------------------

    How would i do this?
     
  10. Offline

    Watto

  11. Offline

    fireblast709

    The_FrosTy_Clan I would say something like the following (and note, I've never modified the HelpMap before :p)
    • Get the HelpMap (Bukkit.getHelpMap())
    • Clear it (HelpMap#clear())
    • Generate a bunch of IndexHelpTopics which you want on the first page when you do /help (A List would keep them sorted)
    • If you want, you could even attach IndexHelpTopics to those, to create a deeper structure (for example, have a section 'Commands', a section 'Reporting hackers', etc. How you fill that in, is all up to you :p)
    • Get the default page and invoke setTopicsCollection(Collection) with your Collection of IndexHelpTopics you would like to display on the first page. You can get this default page by calling getHelpTopic("").
    • ...and that should be all.
    A few notes:
    • Till a certain extend this should be possible with help.yml alone. Of course, if you want to have it a bit dynamic, a plugin should give you that freedom.
    • For commands there is a separate class you might want to look at, it could save you some time: GenericCommandHelpTopic.
    • The two HelpTopic extending classes are extendable and could be used to create your own HelpTopic extensions, in the case you want even more control.
    • [this one is targeted at new developers] If people are confused about the use of Collection, a Collection is just a List or Set (in fact, Collection is a super class - or call them parent classes if you want - of Lists and Sets). You have probably seen them around as ArrayList and HashSet respectively.
     
  12. Offline

    Aephout14

    fireblast709 I just looked at this page, I am using player.sendMessage node and displaying the commands of my plugin, I may try what you said, I will have to read up on it :D.

    Thanks,

    Tyler
     
Thread Status:
Not open for further replies.

Share This Page