Player Join Event not Working

Discussion in 'Programming' started by LandmarkWings03, Jun 20, 2015.

  1. Nothing is working here...
    Code:

    Code (Text):
       public void onPlayerJoin(PlayerJoinEvent event) {
            event.getPlayer().getInventory().setItem(0, createItem(Material.CHEST, 1, false, ChatColor.AQUA + "" + ChatColor.BOLD + "Gadgets", ChatColor.WHITE + "Right-click me to open the gadgets menu"));
            final Player player = event.getPlayer();
                TitleAPI.sendTitle(player,10,10,10,"Hi","Test");
                TitleAPI.sendTabTitle(player,"Another","Test");
            if(player.hasPermission("Join.Use")) {
                instance.getLogger().info(event.getPlayer().getName() + " joined the server! :D");
                player.playSound(player.getLocation(), Sound.CAT_PURREOW, 10, 10);
            } else {
                player.sendMessage(ChatColor.LIGHT_PURPLE + "" + ChatColor.BOLD + "Purchase a Rank for cool stuff!");
                player.playSound(player.getLocation(), Sound.FIZZ, 10, 10);
            }
    ERROR:
    [00:00:01 ERROR]: Could not pass event PlayerJoinEvent to LandmarkWings_Hub v1.6
    org.bukkit.event.EventException
     
    #1 LandmarkWings03, Jun 20, 2015
    Last edited: Jun 20, 2015
  2. Oh god please put that in the code formatter...
     
  3. Anything that will make you happy.
     
  4. Have you got @EventHandler (Not meant to be a member) before it? Have you registered your events?
     
  5. EventException means there was an exception while handling the event, but it's not the correct exception to look at. There should be a line in the error output that starts with: "Caused by:" followed by the initial exception thrown as well as the stack trace.

    Can you please pastebin the entire error output.
     
  6. caused by: java.lang.NoClassDefFoundError: net/minecraft/server/v1_8_R1/Packet
     
  7. The problem is in your TitleAPI
     
  8. I have this above the method: @EventHandler(priority = EventPriority.HIGHEST)
     
  9. Got rid of it and still that error.
    My Spigot build supports Minecraft clients both of versions 1.7.x and of 1.8.x.
     
  10. Well, just read the error and you would see that some classes miss. If you have some Java knowledge, you would know how to fix that.
     
  11. Send the full error please.
     
  12. Code (Text):
    [12:37:55 ERROR]: Could not pass event PlayerJoinEvent to LandmarkWings_Hub v1.6
    org.bukkit.event.EventException
        at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:302) ~[run.jar:git-Spigot-1642]
        at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62) ~[run.jar:git-Spigot-1642]
        at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:514) [run.jar:git-Spigot-1642]
        at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:499) [run.jar:git-Spigot-1642]
        at net.minecraft.server.v1_7_R4.PlayerList.c(PlayerList.java:265) [run.jar:git-Spigot-1642]
        at net.minecraft.server.v1_7_R4.PlayerList.a(PlayerList.java:152) [run.jar:git-Spigot-1642]
        at net.minecraft.server.v1_7_R4.LoginListener.c(LoginListener.java:119) [run.jar:git-Spigot-1642]
        at net.minecraft.server.v1_7_R4.LoginListener.a(LoginListener.java:44) [run.jar:git-Spigot-1642]
        at net.minecraft.server.v1_7_R4.NetworkManager.a(NetworkManager.java:189) [run.jar:git-Spigot-1642]
        at net.minecraft.server.v1_7_R4.ServerConnection.c(ServerConnection.java:81) [run.jar:git-Spigot-1642]
        at net.minecraft.server.v1_7_R4.MinecraftServer.v(MinecraftServer.java:734) [run.jar:git-Spigot-1642]
        at net.minecraft.server.v1_7_R4.DedicatedServer.v(DedicatedServer.java:289) [run.jar:git-Spigot-1642]
        at net.minecraft.server.v1_7_R4.MinecraftServer.u(MinecraftServer.java:584) [run.jar:git-Spigot-1642]
        at net.minecraft.server.v1_7_R4.MinecraftServer.run(MinecraftServer.java:490) [run.jar:git-Spigot-1642]
        at net.minecraft.server.v1_7_R4.ThreadServerApplication.run(SourceFile:628) [run.jar:git-Spigot-1642]
    Caused by: java.lang.NoClassDefFoundError: net/minecraft/server/v1_8_R1/Packet
        at me.landmarkwings.Gadgets.Gadgets.onPlayerJoin(Gadgets.java:393) ~[?:?]
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_45]
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_45]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_45]
        at java.lang.reflect.Method.invoke(Method.java:497) ~[?:1.8.0_45]
        at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:298) ~[run.jar:git-Spigot-1642]
        ... 14 more
    Caused by: java.lang.ClassNotFoundException: net.minecraft.server.v1_8_R1.Packet
        at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:91) ~[run.jar:git-Spigot-1642]
        at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:86) ~[run.jar:git-Spigot-1642]
        at java.lang.ClassLoader.loadClass(ClassLoader.java:424) ~[?:1.8.0_45]
        at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ~[?:1.8.0_45]
        at me.landmarkwings.Gadgets.Gadgets.onPlayerJoin(Gadgets.java:393) ~[?:?]
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_45]
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_45]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_45]
        at java.lang.reflect.Method.invoke(Method.java:497) ~[?:1.8.0_45]
        at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:298) ~[run.jar:git-Spigot-1642]
        ... 14 more
    [12:37:55 ERROR]: Could not pass event PlayerJoinEvent to LandmarkWings_Hub v1.6
    org.bukkit.event.EventException
        at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:302) ~[run.jar:git-Spigot-1642]
        at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62) ~[run.jar:git-Spigot-1642]
        at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:514) [run.jar:git-Spigot-1642]
        at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:499) [run.jar:git-Spigot-1642]
        at net.minecraft.server.v1_7_R4.PlayerList.c(PlayerList.java:265) [run.jar:git-Spigot-1642]
        at net.minecraft.server.v1_7_R4.PlayerList.a(PlayerList.java:152) [run.jar:git-Spigot-1642]
        at net.minecraft.server.v1_7_R4.LoginListener.c(LoginListener.java:119) [run.jar:git-Spigot-1642]
        at net.minecraft.server.v1_7_R4.LoginListener.a(LoginListener.java:44) [run.jar:git-Spigot-1642]
        at net.minecraft.server.v1_7_R4.NetworkManager.a(NetworkManager.java:189) [run.jar:git-Spigot-1642]
        at net.minecraft.server.v1_7_R4.ServerConnection.c(ServerConnection.java:81) [run.jar:git-Spigot-1642]
        at net.minecraft.server.v1_7_R4.MinecraftServer.v(MinecraftServer.java:734) [run.jar:git-Spigot-1642]
        at net.minecraft.server.v1_7_R4.DedicatedServer.v(DedicatedServer.java:289) [run.jar:git-Spigot-1642]
        at net.minecraft.server.v1_7_R4.MinecraftServer.u(MinecraftServer.java:584) [run.jar:git-Spigot-1642]
        at net.minecraft.server.v1_7_R4.MinecraftServer.run(MinecraftServer.java:490) [run.jar:git-Spigot-1642]
        at net.minecraft.server.v1_7_R4.ThreadServerApplication.run(SourceFile:628) [run.jar:git-Spigot-1642]
    Caused by: java.lang.NoClassDefFoundError: net/minecraft/server/v1_8_R1/Packet
        at me.landmarkwings.Gadgets.Gadgets.onPlayerJoin(Gadgets.java:393) ~[?:?]
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_45]
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_45]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_45]
        at java.lang.reflect.Method.invoke(Method.java:497) ~[?:1.8.0_45]
        at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:298) ~[run.jar:git-Spigot-1642]
        ... 14 more
    Caused by: java.lang.ClassNotFoundException: net.minecraft.server.v1_8_R1.Packet
        at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:91) ~[run.jar:git-Spigot-1642]
        at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:86) ~[run.jar:git-Spigot-1642]
        at java.lang.ClassLoader.loadClass(ClassLoader.java:424) ~[?:1.8.0_45]
        at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ~[?:1.8.0_45]
        at me.landmarkwings.Gadgets.Gadgets.onPlayerJoin(Gadgets.java:393) ~[?:?]
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_45]
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_45]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_45]
        at java.lang.reflect.Method.invoke(Method.java:497) ~[?:1.8.0_45]
        at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:298) ~[run.jar:git-Spigot-1642]
        ... 14 more
    [12:37:55 INFO]: LandmarkWings[/0.0.0.0:40922] logged in with entity id 51 at ([world] 254.0, 4.0, 234.0)
    [12:37:56 INFO]: UUID of player Notch is fdef81ef-eb91-3d92-a69a-ac3d66046fd8
    [12:37:57 ERROR]: Could not pass event PlayerJoinEvent to LandmarkWings_Hub v1.6
    org.bukkit.event.EventException
        at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:302) ~[run.jar:git-Spigot-1642]
        at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62) ~[run.jar:git-Spigot-1642]
        at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:514) [run.jar:git-Spigot-1642]
        at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:499) [run.jar:git-Spigot-1642]
        at net.minecraft.server.v1_7_R4.PlayerList.c(PlayerList.java:265) [run.jar:git-Spigot-1642]
        at net.minecraft.server.v1_7_R4.PlayerList.a(PlayerList.java:152) [run.jar:git-Spigot-1642]
        at net.minecraft.server.v1_7_R4.LoginListener.c(LoginListener.java:119) [run.jar:git-Spigot-1642]
        at net.minecraft.server.v1_7_R4.LoginListener.a(LoginListener.java:44) [run.jar:git-Spigot-1642]
        at net.minecraft.server.v1_7_R4.NetworkManager.a(NetworkManager.java:189) [run.jar:git-Spigot-1642]
        at net.minecraft.server.v1_7_R4.ServerConnection.c(ServerConnection.java:81) [run.jar:git-Spigot-1642]
        at net.minecraft.server.v1_7_R4.MinecraftServer.v(MinecraftServer.java:734) [run.jar:git-Spigot-1642]
        at net.minecraft.server.v1_7_R4.DedicatedServer.v(DedicatedServer.java:289) [run.jar:git-Spigot-1642]
        at net.minecraft.server.v1_7_R4.MinecraftServer.u(MinecraftServer.java:584) [run.jar:git-Spigot-1642]
        at net.minecraft.server.v1_7_R4.MinecraftServer.run(MinecraftServer.java:490) [run.jar:git-Spigot-1642]
        at net.minecraft.server.v1_7_R4.ThreadServerApplication.run(SourceFile:628) [run.jar:git-Spigot-1642]
    Caused by: java.lang.NoClassDefFoundError: net/minecraft/server/v1_8_R1/Packet
        at me.landmarkwings.Gadgets.Gadgets.onPlayerJoin(Gadgets.java:393) ~[?:?]
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_45]
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_45]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_45]
        at java.lang.reflect.Method.invoke(Method.java:497) ~[?:1.8.0_45]
        at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:298) ~[run.jar:git-Spigot-1642]
        ... 14 more
    Caused by: java.lang.ClassNotFoundException: net.minecraft.server.v1_8_R1.Packet
        at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:91) ~[run.jar:git-Spigot-1642]
        at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:86) ~[run.jar:git-Spigot-1642]
        at java.lang.ClassLoader.loadClass(ClassLoader.java:424) ~[?:1.8.0_45]
        at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ~[?:1.8.0_45]
        at me.landmarkwings.Gadgets.Gadgets.onPlayerJoin(Gadgets.java:393) ~[?:?]
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_45]
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_45]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_45]
        at java.lang.reflect.Method.invoke(Method.java:497) ~[?:1.8.0_45]
        at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:298) ~[run.jar:git-Spigot-1642]
        ... 14 more
    [12:37:57 ERROR]: Could not pass event PlayerJoinEvent to LandmarkWings_Hub v1.6
    org.bukkit.event.EventException
        at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:302) ~[run.jar:git-Spigot-1642]
        at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62) ~[run.jar:git-Spigot-1642]
        at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:514) [run.jar:git-Spigot-1642]
        at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:499) [run.jar:git-Spigot-1642]
        at net.minecraft.server.v1_7_R4.PlayerList.c(PlayerList.java:265) [run.jar:git-Spigot-1642]
        at net.minecraft.server.v1_7_R4.PlayerList.a(PlayerList.java:152) [run.jar:git-Spigot-1642]
        at net.minecraft.server.v1_7_R4.LoginListener.c(LoginListener.java:119) [run.jar:git-Spigot-1642]
        at net.minecraft.server.v1_7_R4.LoginListener.a(LoginListener.java:44) [run.jar:git-Spigot-1642]
        at net.minecraft.server.v1_7_R4.NetworkManager.a(NetworkManager.java:189) [run.jar:git-Spigot-1642]
        at net.minecraft.server.v1_7_R4.ServerConnection.c(ServerConnection.java:81) [run.jar:git-Spigot-1642]
        at net.minecraft.server.v1_7_R4.MinecraftServer.v(MinecraftServer.java:734) [run.jar:git-Spigot-1642]
        at net.minecraft.server.v1_7_R4.DedicatedServer.v(DedicatedServer.java:289) [run.jar:git-Spigot-1642]
        at net.minecraft.server.v1_7_R4.MinecraftServer.u(MinecraftServer.java:584) [run.jar:git-Spigot-1642]
        at net.minecraft.server.v1_7_R4.MinecraftServer.run(MinecraftServer.java:490) [run.jar:git-Spigot-1642]
        at net.minecraft.server.v1_7_R4.ThreadServerApplication.run(SourceFile:628) [run.jar:git-Spigot-1642]
    Caused by: java.lang.NoClassDefFoundError: net/minecraft/server/v1_8_R1/Packet
        at me.landmarkwings.Gadgets.Gadgets.onPlayerJoin(Gadgets.java:393) ~[?:?]
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_45]
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_45]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_45]
        at java.lang.reflect.Method.invoke(Method.java:497) ~[?:1.8.0_45]
        at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:298) ~[run.jar:git-Spigot-1642]
        ... 14 more
    Caused by: java.lang.ClassNotFoundException: net.minecraft.server.v1_8_R1.Packet
        at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:91) ~[run.jar:git-Spigot-1642]
        at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:86) ~[run.jar:git-Spigot-1642]
        at java.lang.ClassLoader.loadClass(ClassLoader.java:424) ~[?:1.8.0_45]
        at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ~[?:1.8.0_45]
        at me.landmarkwings.Gadgets.Gadgets.onPlayerJoin(Gadgets.java:393) ~[?:?]
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_45]
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_45]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_45]
        at java.lang.reflect.Method.invoke(Method.java:497) ~[?:1.8.0_45]
        at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:298) ~[run.jar:git-Spigot-1642]
        ... 14 more
     
     
  13. try updating the plugin to the latest version of Spigot/Bukkit
     
  14. Gadgets.java:393 This is stating that u have an error on Line 393 in the Gadgets class file
     
  15. Line 393 does not show on error in eclipse. It is --> }else{.
     
  16. I'm using the 1.7 Spigot API.
     
  17. If it's saying the error is at "else" then the current jar was not built from the source code as it is now.

    Create a new jar using your current source code and run it again to get the correct line.
     
  18. Solved the Problem! :D
     
    • Like Like x 2