Plugin Development - A HUGE tutorial!

Discussion in 'Plugin Development' started by Adamki11s, Apr 29, 2011.

?

Was this helpful to you?

  1. Yes!

    78.4%
  2. No, but it was a good tutorial :)

    16.1%
  3. No.

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

    Sagacious_Zed Bukkit Docs

    Reading through it, I noticed that the tutorial never mentions using getCommand("").setExecutor
     
  2. Offline

    SpikeMeister

    I started writing a section on that but I decided it might be too complicated and not necessarily appropriate for the tutorial, of course if people disagree they are free to write it themselves
     
  3. Offline

    desht

    Well, I took it upon myself to add a couple of sections to the Commands chapter:
    Hope they're helpful!
     
    SpikeMeister likes this.
  4. Offline

    stelar7

    I've been wondering why people use:
    Code:java
    1. if (cmd.getName().equalsIgnoreCase("basic2") {
    instad of:
    Code:java
    1. if (commandLabel.equalsIgnoreCase("basic2") {
    is there a special reason for this?
     
  5. It's just habit, both work fine.
     
  6. Offline

    Acrobot

    @Adamki11s
    They don't.
    CommandLabel means alias.
    cmd.getName() means the REAL command name.

    If your command has, for example, "basic" command with "basic2" alias, if you use the "commandLabel" method (English word, not Java), it won't work.
    However, if you use cmd.getName(), both "basic" and "basic2" return "basic" - the base command.
     
  7. Ah ok, thanks for clearing that up.
     
  8. Offline

    Evangon

    I need a little help.
    When using the tutorials PlayerListener, or specificlly this line:
    Code:
    public static CatFaic plugin; public CatFaicPlayerListener(Basic instance) {
    It says Basic cannot be resolved to a type. Do I import Basic from javax.presistence?
    I mean, what do I do? It just has a big bolded underline error.
     
  9. You are passing the instance of your plugins main class so basic should be whatever the name of your main class is :).
     

  10. Should be...


    Code:
    public static CatFaic plugin;
    
    public CatFaicPlayerListener(CatFaic instance) //when you are passing the instance to your plugin, your referencing your plugin, so your plugin name should be there :) {
    
    this.instance=plugin;
    }
    
     
  11. Offline

    Evangon

    Thanks :p

    MOVED TO IT'S OWN THREAD.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 14, 2016
  12. Offline

    teetor

    like me ;)
     
Thread Status:
Not open for further replies.

Share This Page