Toggle Command Problem! Urgent!

Discussion in 'Plugin Development' started by AdityaTD, Oct 29, 2015.

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

    AdityaTD

    Hey there, so I was updating my plugin with a toggle command and it toggles tab or title by looking if they are set to true or false in the config and if it's one of them then it changes it to it's opposite. So the problem is with Tab Command, it says it's disabled but it's actually not in the config file and it's not saying anything else like the title command.

    Here's my code:

    Code:
                              if(!(args.length == 0)){
                              if(args[0].equalsIgnoreCase("title")){
                                  if(getConfig().getBoolean("title-enabled") == true){
                                      getConfig().set("title-enabled", false);
                                      p.sendMessage(ChatColor.GOLD + "[TitleWelcomeMessage] " + ChatColor.RED + "Titles on Join is now disabled.");
                                        saveConfig();
                                        reloadConfig();
                                  } else if(getConfig().getBoolean("title-enabled") == false){
                                      getConfig().set("title-enabled", true);
                                      p.sendMessage(ChatColor.GOLD + "[TitleWelcomeMessage] " + ChatColor.GREEN + "Titles on Join is now enabled.");
                                      saveConfig();
                                      reloadConfig();
                                  }
                              }
                             
                                 
                                  ////// TAB
                                 
                              if(args[0].equalsIgnoreCase("tab")){
                                  if(getConfig().getBoolean("tab-enabled") == true){
                                      getConfig().set("title-enabled", false);
                                      p.sendMessage(ChatColor.GOLD + "[TitleWelcomeMessage] " + ChatColor.RED + "Tab Text on Join is now disabled.");
                                        saveConfig();
                                        reloadConfig();
                                  } else if(getConfig().getBoolean("tab-enabled") == false){
                                      getConfig().set("title-enabled", true);
                                      p.sendMessage(ChatColor.GOLD + "[TitleWelcomeMessage] " + ChatColor.GREEN + "Tab Text on Join is now enabled.");
                                      saveConfig();
                                      reloadConfig();
                                  }
                                  }
                              }
    Please help, it's urgent.
     
  2. Offline

    ChipDev

    any errors?
    Debug.
     
Thread Status:
Not open for further replies.

Share This Page