Hey guys i am still kind of new to the bukkit api but i do know some things all i would like to know is how to make a currency for my server like coins and have it save in a config.yml file how would i do this i would like to be able to give money to a player when an event happens so if you could help me make an method for this that would be helpful thanks Oh one more thing i would also need an method to remove coins to thanks
killerzz1 Everything you need to know is here: http://jd.bukkit.org/rb/doxygen/d7/deb/classorg_1_1bukkit_1_1plugin_1_1java_1_1JavaPlugin.html and here: http://jd.bukkit.org/rb/doxygen/dd/...nfiguration_1_1file_1_1FileConfiguration.html
killerzz1 That shows all information about all of the methods for the JavaPlugin class and the FileConfiguration class.
killerzz1 JavaPlugin#getConfig(), JavaPlugin#saveConfig(), FileConfiguration#get(), FileConfiguration#set(). Everything you need to know took me about 30 seconds to find.
Ok so i have done this but when i join the server it is not changing anything in the config.yml Code:java private void giveMoney(Player p, int i) { getConfig().getDouble(p.getName() + ".money"); } @EventHandler public void onJoin(PlayerJoinEvent e) { Player p = e.getPlayer(); giveMoney(p, 1); getConfig().set(p.getName() + ".money", getConfig().getInt(p.getName() + ".money")); saveConfig(); }