Hi there Can somone give me an exemple, how to Create a config file.. http://wiki.bukkit.org/HUGE_Plugin_Tutorial#Plugin_Configuration.2FSettings I saw this description in the Plugin Tutorial, but really don't understand how to Create the config fil. Pleas an Exemple..
Alright, my specialty. Just kidding... What you need to have in order to change the configuration file is a reference to your JavaPlugin subclass. Like this: Code: JavaPlugin myPlugin = [...]; Now in the JavaPlugin class, there's two methods you basically need to focus on. That is: Code: myPlugin.getConfig(); myPlugin.saveConfig(); saveConfig() obviously saves the config. You should call this either after you have made an adjustment or in general when the onDisable() method of your plugin is called. getConfig() returns a FileConfiguration (see http://jd.bukkit.org/apidocs/org/bukkit/configuration/file/FileConfiguration.html), which you can call methods on. That FileConfiguration is either loaded from your config.yml or if that doesn't exist, a new one is created. saveConfig() by the way saves to that exact same file, like you might have figured. It's actually quite simple. Check the API documentation (the link I posted above) for more information about the use of and methods within the FileConfiguration class. Have fun, and keep in mind that this should only be used for preferences and in general things the server admin should have direct access to. Not more. For example using this technique for saving blocks (which would also be very complicated) is a waste of your time and resources. Another way to save stuff would be a database, or this: http://wiki.bukkit.org/Plugin_Tutorial#HashMaps_and_How_to_Use_Them You should generally know this tutorial in it's entirety. I hope I could help. -Kierrow