Im getting a NPE at my cooldown class on line 21: Line 21: plugin.cooldown1.put(player.getName(), plugin.cooldown1.get(player.getName()) - 1); Does anyone know why?
Yekllurt teej107 new error: Spoiler (Move your mouse to the spoiler area to reveal the content) Show Spoiler Hide Spoiler ... 15 more [20:04:15 ERROR]: Could not pass event PlayerInteractEvent to FunCannon v1.0.0 org.bukkit.event.EventException at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.ja va:294) ~[craftbukkit.jar:git-Bukkit-1.7.9-R0.2-24-g07d4558-b3116jnks] at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.jav a:62) ~[craftbukkit.jar:git-Bukkit-1.7.9-R0.2-24-g07d4558-b3116jnks] at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.j ava:501) [craftbukkit.jar:git-Bukkit-1.7.9-R0.2-24-g07d4558-b3116jnks] at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.j ava:486) [craftbukkit.jar:git-Bukkit-1.7.9-R0.2-24-g07d4558-b3116jnks] at org.bukkit.craftbukkit.v1_7_R4.event.CraftEventFactory.callPlayerInte ractEvent(CraftEventFactory.java:225) [craftbukkit.jar:git-Bukkit-1.7.9-R0.2-24- g07d4558-b3116jnks] at org.bukkit.craftbukkit.v1_7_R4.event.CraftEventFactory.callPlayerInte ractEvent(CraftEventFactory.java:195) [craftbukkit.jar:git-Bukkit-1.7.9-R0.2-24- g07d4558-b3116jnks] at net.minecraft.server.v1_7_R4.PlayerConnection.a(PlayerConnection.java :606) [craftbukkit.jar:git-Bukkit-1.7.9-R0.2-24-g07d4558-b3116jnks] at net.minecraft.server.v1_7_R4.PacketPlayInBlockPlace.a(SourceFile:60) [craftbukkit.jar:git-Bukkit-1.7.9-R0.2-24-g07d4558-b3116jnks] at net.minecraft.server.v1_7_R4.PacketPlayInBlockPlace.handle(SourceFile :9) [craftbukkit.jar:git-Bukkit-1.7.9-R0.2-24-g07d4558-b3116jnks] at net.minecraft.server.v1_7_R4.NetworkManager.a(NetworkManager.java:157 ) [craftbukkit.jar:git-Bukkit-1.7.9-R0.2-24-g07d4558-b3116jnks] at net.minecraft.server.v1_7_R4.ServerConnection.c(SourceFile:134) [craf tbukkit.jar:git-Bukkit-1.7.9-R0.2-24-g07d4558-b3116jnks] at net.minecraft.server.v1_7_R4.MinecraftServer.v(MinecraftServer.java:6 67) [craftbukkit.jar:git-Bukkit-1.7.9-R0.2-24-g07d4558-b3116jnks] at net.minecraft.server.v1_7_R4.DedicatedServer.v(DedicatedServer.java:2 58) [craftbukkit.jar:git-Bukkit-1.7.9-R0.2-24-g07d4558-b3116jnks] at net.minecraft.server.v1_7_R4.MinecraftServer.u(MinecraftServer.java:5 58) [craftbukkit.jar:git-Bukkit-1.7.9-R0.2-24-g07d4558-b3116jnks] at net.minecraft.server.v1_7_R4.MinecraftServer.run(MinecraftServer.java :469) [craftbukkit.jar:git-Bukkit-1.7.9-R0.2-24-g07d4558-b3116jnks] at net.minecraft.server.v1_7_R4.ThreadServerApplication.run(SourceFile:6 28) [craftbukkit.jar:git-Bukkit-1.7.9-R0.2-24-g07d4558-b3116jnks] Caused by: java.lang.NullPointerException at me.jordypwner.FunCannon.FunCannon3.onPlayerInteract(FunCannon3.java:3 1) ~[?:?] at sun.reflect.GeneratedMethodAccessor25.invoke(Unknown Source) ~[?:?] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1 .7.0_60] at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.7.0_60] at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.ja va:292) ~[craftbukkit.jar:git-Bukkit-1.7.9-R0.2-24-g07d4558-b3116jnks] ... 15 more line 31: if (plugin.cooldown1.get(p.getName()) <= 0) {
don't bump your thread within 24 hours And no one will spoon-feed you, so first learn some java before you start working with the bukkit api
JordyPwner Don't give such an arrogant attitude to people who are telling you the truth. The questions you're asking prove that you don't have any basic Java knowledge, and no, you didn't 'forget' where to put it, you don't have any idea.
If you want to check whether a player is in the cooldown1 HashMap before doing that, put it around where you get the values from the HashMap. (line 21) Also, it's best learn Java and then do it if you don't understand what your doing.
I agree with this If you learn Java first, you can program things yourself, and you don't have to ask the 'basic' things anymore. I'm not a pro developer nor a Idiot, I need help too, but I'm just telling you the truth. And you won't learn from a "good answer" because 100% of the "spoon-feed" will be copy-pasted into your class xD. You asked for a full spoon-feeded class, and I think a lot of the people here won't help people that ask for it. How can you forget this?! If you don't know where to place that piece of code, you can better redo the basics. And be a little bit more polite... people try to help you and saying "stfu" for telling you to learn the basics of Java first, isn't nice at all. If you talk like that, no one is going to help you with the problems that you're facing. I just want to tell you that being polite will help you more. A second tip I will give you is go learn the basics first. If you can't handle the basic Java knowledge, you won't know how to use the Bukkit API either. Maybe this will help you - Stack-trace debug: http://forums.bukkit.org/threads/ho...ubleshoot-your-own-plugins-by-yourself.32457/ - Java basics (Here you can find a lot of useful things): http://docs.oracle.com/javase/tutorial/java/nutsandbolts/ - Java docs: http://docs.oracle.com/javase/7/docs/api/ [EDIT] Still not convinced? Check this: http://forums.bukkit.org/threads/java-then-bukkit-api.306934/