Why does it throw NullPointerExceptions when I use it? VV public static boolean playerExists(String playerName) { return plugin.getConfig().contains(playerName); } I checked: @EventHandler public void onPlayerJoin(PlayerJoinEvent event) { Broadcasts.joinBroadcast(event); if (!Tools.playerExists(event.getPlayer().getName())) { Economy.addPlayer(event.getPlayer().getName()); } } And got big NullPointerException. Why does it happen?
Instead try: Code:java public static boolean playerExists(String playerName) { return plugin.getConfig().contains(playerName) != null;}