I am trying to get a configuration file to be generated if it doesn't exist, I tried: Code:java @Override public void onEnable() { System.out.println("[COPS]" + pdfFile.getVersion() + " has been enabled."); configFile=new File("plugins" + File .separator + "Cops" + File .separator + "config.yml"); if(!configFile.exists()){ try { configFile.createNewFile(); System.out.println("[COPS] Created config.yml in 'Plugins/Cops/'!"); } catch (IOException e) { e.printStackTrace(); } } } Oh by the way, it throws an error when it enables, saying its out of date. Any fix on that? Do I need to use loggers? Now, I'm trying to make it so a player has to teleport to the requested player in 60 seconds. Not sure how to do it. But here is the source code so you know where to put it. Code:java // /cops call if (args[0].equalsIgnoreCase("call") && sender.hasPermission("cops.call")){ System.out.println(sender.getName() + ": /cops call"); sender.sendMessage(ChatColor.BLUE + "911 Police Department, contacting local enforcement."); for(Player playerCop : this.getServer().getOnlinePlayers()){ if(playerCop.hasPermission("cops.cop")){ playerCop.sendMessage(ChatColor.BOLD + "" + sender.getName() + " called for police!"); playerCop.sendMessage(ChatColor.DARK_GREEN + "Would you like to teleport to " + ChatColor.GOLD + sender.getName() + ChatColor.DARK_GREEN + "?"); playerCop.sendMessage(ChatColor.GOLD + "/cops tpaccept" + ChatColor.DARK_GREEN + " or " + ChatColor.GOLD + "/cops tpdecline"); } } }
I don't want to edit the syntax since it will delete the spaces. I have every command surrounded by an if ((sender instanceof player))
No that's not what the error says, the error is pointing you to the line where the error is, read: http://forums.bukkit.org/threads/ho...ubleshoot-your-own-plugins-by-yourself.32457/ Also, you should use getLogger().info() (or just store getLogger() in onEnable() ), that will automatically add the plugin name to the log. You also don't need to print enabled messages, bukkit does that, and you adding another one fills the console with repeatitive and pointless info. Still, you're complicating yourself with checking for config and stuff... you don't need to do any of that, just use getConfig() and it will create/load the file and get the stuff you need, it does that the first time it's called, if you want to reload the config use reloadConfig() and if you want to save, just use saveConfig(). About the 2nd issue, use a task, read here: http://wiki.bukkit.org/Scheduler_Programming
Okay, well, I also need help making another configuration file, where it will generate it like <server directory>\plugins\Cops\<file>.yml
The custom config tutorial: http://wiki.bukkit.org/Introduction...Reloading.2C_and_Saving_Custom_Configurations