Here is the error I am receiving when I load up the plugin I made: Code: 15:38:25 [SEVERE] Could not load 'plugins\tempteleport.jar' in folder 'plugins' org.bukkit.plugin.InvalidPluginException: java.lang.IllegalArgumentException: File cannot be null I'm assuming it's saying that one of the files is empty but they are all filled with code. TTP.java config.yml plugin.yml I have no idea what to do. I am also hesitant to put my code up here for people to use and copy so if you need it to find the bug, I will PM it to you. Thanks in advance! ~SteppingHat
is there anything more to that stacktrace? if not, i... think your plugin.yml is null, or doesnt point to the correct main class.
Please use the search function: http://forums.bukkit.org/search/7481775/?q=File cannot be null&o=date&c[title_only]=1&c[node]=5
It's got something to do with the config. When I removed anything that required/loaded the config, the plugin loaded fine. Code: package com.gmail.steppinghat; import java.util.logging.Logger; import org.bukkit.ChatColor; import org.bukkit.Location; import org.bukkit.command.Command; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; import org.bukkit.plugin.PluginDescriptionFile; import org.bukkit.plugin.java.JavaPlugin; public class TempTeleport extends JavaPlugin { public static TempTeleport plugin; public final Logger logger = Logger.getLogger("Minecraft"); Logger log = Logger.getLogger("Minecraft"); @Override public void onDisable() { PluginDescriptionFile pdfFile = this.getDescription(); this.logger.info(pdfFile.getName() + " has been disabled!"); } public static int CONF_time; @Override public void onEnable() { PluginDescriptionFile pdfFile = this.getDescription(); log.info("--------TEMPTELEPORT by SteppingHat--------"); this.logger.info(pdfFile.getName() + " v" + pdfFile.getVersion() + " has been enabled!"); log.info("-------------------------------------------"); this.getConfig().options().copyDefaults(true); this.saveConfig(); CONF_time = getConfig().getInt("time"); } There's the code.
This error happens already at loading. Does java has enough rights to create files/folders in your bukkit directory? PS: You should not get the Minecraft-Logger for logging. There is a getLogger() method you could use. I also does the plugin prefixing for you automatically.
There are dozens of thready about this already, and the solution was always not to use getConfig() before onEnable() is called.