hi i need help with this, Code: [04:39:37] [Server thread/WARN]: [Anni] Task #32 for Anni v${project.version} generated an exception java.lang.NullPointerException at net.coasterman10.Annihilation.Annihilation.startGame(Annihilation.java:441) ~[?:?] at net.coasterman10.Annihilation.Annihilation.onSecond(Annihilation.java:516) ~[?:?] at net.coasterman10.Annihilation.manager.PhaseManager.onSecond(PhaseManager.java:141) ~[?:?] at net.coasterman10.Annihilation.manager.PhaseManager.access$0(PhaseManager.java:109) ~[?:?] at net.coasterman10.Annihilation.manager.PhaseManager$1.run(PhaseManager.java:56) ~[?:?] at org.bukkit.craftbukkit.v1_7_R1.scheduler.CraftTask.run(CraftTask.java:53) ~[b.jar:git-Bukkit-1.7.2-R0.3-2-g85f5776-b3024jnks] at org.bukkit.craftbukkit.v1_7_R1.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:345) [b.jar:git-Bukkit-1.7.2-R0.3-2-g85f5776-b3024jnks] at net.minecraft.server.v1_7_R1.MinecraftServer.u(MinecraftServer.java:587) [b.jar:git-Bukkit-1.7.2-R0.3-2-g85f5776-b3024jnks] at net.minecraft.server.v1_7_R1.DedicatedServer.u(DedicatedServer.java:250) [b.jar:git-Bukkit-1.7.2-R0.3-2-g85f5776-b3024jnks] at net.minecraft.server.v1_7_R1.MinecraftServer.t(MinecraftServer.java:545) [b.jar:git-Bukkit-1.7.2-R0.3-2-g85f5776-b3024jnks] at net.minecraft.server.v1_7_R1.MinecraftServer.run(MinecraftServer.java:457) [b.jar:git-Bukkit-1.7.2-R0.3-2-g85f5776-b3024jnks] at net.minecraft.server.v1_7_R1.ThreadServerApplication.run(SourceFile:617) [b.jar:git-Bukkit-1.7.2-R0.3-2-g85f5776-b3024jnks] i am customizing a plugin and i need help with this ^ could some1 help? this is where the problems coming from: Code:java public void startGame() {for (Player p : Bukkit.getOnlinePlayers()) {for (Player pp : Bukkit.getOnlinePlayers()) {p.showPlayer(pp);pp.showPlayer(p);}} Bukkit.getPluginManager().callEvent(new GameStartEvent(maps.getCurrentMap()));sb.scores.clear(); for (OfflinePlayer score : sb.sb.getPlayers())sb.sb.resetScores(score); sb.obj.setDisplayName(ChatColor.DARK_AQUA + "Map: "+ WordUtils.capitalize(voting.getWinner())); for (GameTeam t : GameTeam.teams()) {sb.scores.put(t.name(), sb.obj.getScore(Bukkit.getOfflinePlayer(WordUtils.capitalize(t.name().toLowerCase() + " Nexus"))));sb.scores.get(t.name()).setScore(t.getNexus().getHealth()); Team sbt = sb.sb.registerNewTeam(t.name() + "SB");sbt.addPlayer(Bukkit.getOfflinePlayer(WordUtils.capitalize(WordUtils.capitalize(t.name().toLowerCase()+ " Nexus"))));sbt.setPrefix(t.color().toString());} sb.obj.setDisplayName(ChatColor.DARK_AQUA + "Map: "+ WordUtils.capitalize(voting.getWinner())); for (Player p : getServer().getOnlinePlayers())if (PlayerMeta.getMeta(p).getTeam() != GameTeam.NONE)Util.sendPlayerToGame(p, this); sb.update();getServer().getScheduler().runTaskTimer(this, new Runnable() {public void run() {for (Player p : getServer().getOnlinePlayers()) {if (PlayerMeta.getMeta(p).getKit() == Kit.SCOUT) {PlayerMeta.getMeta(p).getKit().addScoutParticles(p);}}}}, 0L, 1200L); getServer().getScheduler().runTaskTimer(this, new Runnable() {public void run() {for (GameTeam t : GameTeam.values()) {if (t != GameTeam.NONE && t.getNexus().isAlive()) {Location nexus = t.getNexus().getLocation().clone();nexus.add(0.5, 0, 0.5);Util.ParticleEffects.sendToLocation(Util.ParticleEffects.ENDER, nexus, 1F, 1F, 1F, 0, 20);Util.ParticleEffects.sendToLocation(Util.ParticleEffects.ENCHANTMENT_TABLE, nexus, 1F, 1F, 1F, 0, 20);}}}}, 100L, 5L); }
Well, first off I want to send you this page on the Plugin Development section that will help you read stack-traces: http://forums.bukkit.org/threads/ho...ubleshoot-your-own-plugins-by-yourself.32457/ After you've read that then come back here for help. A NullPointerException is pretty common, but means that something is trying to be executed, but it equals null so there's nothing to execute.
i know what null is don't worry its just that iv'e had this problem for awhile. its probably cause by the on second start dely EDIT by Moderator: merged posts, please use the edit button instead of double posting.
Well then probably the variable sb is null. Try to make some debug messages like System.out.println(sb);