Hello, I am making a plugin that has stats involved in it and when i join the server it gives you your stats but if the player has not done one of the stats E.G. Get a kill it will say "kills: null" how do i change it from a null value to 0? If you need to see the code just ask thanks
I don't know if I am or not Code: public class deaths { public static void setTimesdied(Player p){ int deaths = Main.getInstance().settingsp.getplayer().getInt(p.getName()+".deaths"); deaths = deaths+1; Main.getInstance().settingsp.getplayer().set(p.getName()+".deaths", deaths); Main.getInstance().settingsp.saveplayer(); } } Here is my method for adding the deaths to a config.yml
@killerzz1 When a player join for the first time, save in the config his kill as 0, or just check in your method if the player has killed or no.