Solved Plugin not giving stack traces, but only returning usage

Discussion in 'Plugin Development' started by SpongyBacon, Mar 17, 2014.

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

    SpongyBacon

    Solved

    Ok, so i'm working on a simple kits plugin, but it's only returning the usage when I type a command, and some of the p.sendMessage("");'s.

    Main Class (Only class):
    Plugin.yml:

    Thanks :D
     
  2. Offline

    StealerSlain

    You must put return true, when command is performed.

    So in your code change

    Code:java
    1. if(cmd.getName().equalsIgnoreCase("kits")){
    2.  
    3. p.sendMessage(ChatColor.DARK_RED + "[Kits] " + ChatColor.RED + "Available Kits:");
    4.  
    5.  
    6.  
    7. if(getConfig().getConfigurationSection("kits") == null){
    8.  
    9. p.sendMessage("ERROR: There are no kits available. (Have you configured them?)" + "\nCreating new configurationSection.");
    10.  
    11. getConfig().createSection("kits");
    12.  
    13. saveConfig();
    14.  
    15. }


    to

    Code:java
    1. if(cmd.getName().equalsIgnoreCase("kits")){
    2. p.sendMessage(ChatColor.DARK_RED + "[Kits] " + ChatColor.RED + "Available Kits:");
    3. return true;
    4. if(getConfig().getConfigurationSection("kits") == null){
    5. p.sendMessage("ERROR: There are no kits available. (Have you configured them?)" + "\nCreating new configurationSection.");
    6. getConfig().createSection("kits");
    7. saveConfig();
    8. return true;
    9. }


     
    SpongyBacon likes this.
  3. Offline

    SpongyBacon

    StealerSlain Woah thanks for the fast reply! Literally just got told this on skype, but thanks for the help :D
     
Thread Status:
Not open for further replies.

Share This Page