Solved Advanced Way to apply commands? (sk89q's @Command API)

Discussion in 'Plugin Development' started by jojohnson1, Nov 29, 2012.

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

    jojohnson1

    Hey Guys,
    as i get more and more advanced in plugin development, i'd like to know whether the only way to apply commands is to add them in your plugin.yml. I wonder whether it is possible to make something like Bukkit.getSuchAndSuch().applyCommand(String command, String description, ...); which might be useful.

    There is someone who did something like that, this Guy is called sk89q and guess what, we all know him.
    In e.g. WorldEdit (and in many other plugins as well) he uses a code like this:

    Code:java
    1. @Command(cmd="afk", description="sets you afk"...)
    Code:java
    1.  
    2. [FONT=arial]public void afk(...) {[/FONT]
    3.  
    4. [FONT=arial]}[/FONT]


    I'd really like to know how this works, can someone tell me?


    Links:
    His API Class for @Command
    An Example of use

    EDIT: Something went wrong with the syntax command. I'm sorry for that.
     
  2. Offline

    lDucks

    He still defines it in his plugin.yml

    All commands need to be defined there. The API he has is just to make it "cleaner" when listening for commands. I use my own command API like that as well ;P
     
  3. Offline

    ZeusAllMighty11

    Yes, there is a way to create commands without registering them in the plugin.yml.

    I will try to find the post. It requires knowledge of packet sending though

     
  4. Offline

    jojohnson1

    hm, okay, seems more complicated than i thought. i'll keep your ideas in mind. Thank you for your help, though.
     
  5. Offline

    Ranzdo

Thread Status:
Not open for further replies.

Share This Page