Error

Discussion in 'Spigot Plugin Development' started by Jirik, Jul 10, 2015.

  1. Code (Text):
    [16:36:25 ERROR]: Could not pass event PlayerJoinEvent to HayAnni v1.0
    org.bukkit.event.EventException
            at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.ja
    va:302) ~[server.jar:git-Spigot-1649]
            at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.jav
    a:62) ~[server.jar:git-Spigot-1649]
            at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.j
    ava:514) [server.jar:git-Spigot-1649]
            at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.j
    ava:499) [server.jar:git-Spigot-1649]
            at net.minecraft.server.v1_7_R4.PlayerList.c(PlayerList.java:265) [serve
    r.jar:git-Spigot-1649]
            at net.minecraft.server.v1_7_R4.PlayerList.a(PlayerList.java:152) [serve
    r.jar:git-Spigot-1649]
            at net.minecraft.server.v1_7_R4.LoginListener.c(LoginListener.java:119)
    [server.jar:git-Spigot-1649]
            at net.minecraft.server.v1_7_R4.LoginListener.a(LoginListener.java:44) [
    server.jar:git-Spigot-1649]
            at net.minecraft.server.v1_7_R4.NetworkManager.a(NetworkManager.java:189
    ) [server.jar:git-Spigot-1649]
            at net.minecraft.server.v1_7_R4.ServerConnection.c(ServerConnection.java
    :81) [server.jar:git-Spigot-1649]
            at net.minecraft.server.v1_7_R4.MinecraftServer.v(MinecraftServer.java:7
    34) [server.jar:git-Spigot-1649]
            at net.minecraft.server.v1_7_R4.DedicatedServer.v(DedicatedServer.java:2
    89) [server.jar:git-Spigot-1649]
            at net.minecraft.server.v1_7_R4.MinecraftServer.u(MinecraftServer.java:5
    84) [server.jar:git-Spigot-1649]
            at net.minecraft.server.v1_7_R4.MinecraftServer.run(MinecraftServer.java
    :490) [server.jar:git-Spigot-1649]
            at net.minecraft.server.v1_7_R4.ThreadServerApplication.run(SourceFile:6
    28) [server.jar:git-Spigot-1649]
    Caused by: java.lang.NullPointerException
            at org.bukkit.craftbukkit.v1_7_R4.entity.CraftPlayer.teleport(CraftPlaye
    r.java:500) ~[server.jar:git-Spigot-1649]
            at org.bukkit.craftbukkit.v1_7_R4.entity.CraftEntity.teleport(CraftEntit
    y.java:200) ~[server.jar:git-Spigot-1649]
            at cz.HayCraft.HayAnni.Main.onPlayerJoin(Main.java:38) ~[?:?]
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0
    _45]
            at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0
    _45]
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1
    .8.0_45]
            at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_45]
            at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.ja
    va:298) ~[server.jar:git-Spigot-1649]
            ... 14 more
     
  2. Please post your code! Otherwise we could not help!
     
  3. @Jirik The variable lobby is equal to null, thats the error.

    This is a really easy error, it would help you if you read the exception first, before posting this here!
     
  4. You could just /setworldspawn and then execute,
    player.teleport(Bukkit.getWorld("world").getSpawnLocation());
     
  5. Post your code here, to be exact, the 38th line.