Could not pass event PlayerJoinEvent

Discussion in 'Plugin Development' started by ethant, Jun 4, 2016.

Thread Status:
Not open for further replies.
  1. Offline

    ethant

    Hello I am kinda new to java but I was making a normal and easy onjoin title And I have no errors in eclipse but in console I getting this error
    Code:
    Could not pass event PlayerJoinEvent to WelcomeTitle v1.0
    org.bukkit.event.EventException
            at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:310) ~[spigot.jar:git-Spigot-db6de12-18fbb24]
            at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62) ~[spigot.jar:git-Spigot-db6de12-18fbb24]
            at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:502) [spigot.jar:git-Spigot-db6de12-18fbb24]
            at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:487) [spigot.jar:git-Spigot-db6de12-18fbb24]
            at net.minecraft.server.v1_8_R3.PlayerList.onPlayerJoin(PlayerList.java:298) [spigot.jar:git-Spigot-db6de12-18fbb24]
            at net.minecraft.server.v1_8_R3.PlayerList.a(PlayerList.java:157) [spigot.jar:git-Spigot-db6de12-18fbb24]
            at net.minecraft.server.v1_8_R3.LoginListener.b(LoginListener.java:144) [spigot.jar:git-Spigot-db6de12-18fbb24]
            at net.minecraft.server.v1_8_R3.LoginListener.c(LoginListener.java:54) [spigot.jar:git-Spigot-db6de12-18fbb24]
            at net.minecraft.server.v1_8_R3.NetworkManager.a(NetworkManager.java:231) [spigot.jar:git-Spigot-db6de12-18fbb24]
            at net.minecraft.server.v1_8_R3.ServerConnection.c(ServerConnection.java:148) [spigot.jar:git-Spigot-db6de12-18fbb24]
            at net.minecraft.server.v1_8_R3.MinecraftServer.B(MinecraftServer.java:814) [spigot.jar:git-Spigot-db6de12-18fbb24]
            at net.minecraft.server.v1_8_R3.DedicatedServer.B(DedicatedServer.java:374) [spigot.jar:git-Spigot-db6de12-18fbb24]
            at net.minecraft.server.v1_8_R3.MinecraftServer.A(MinecraftServer.java:654) [spigot.jar:git-Spigot-db6de12-18fbb24]
            at net.minecraft.server.v1_8_R3.MinecraftServer.run(MinecraftServer.java:557) [spigot.jar:git-Spigot-db6de12-18fbb24]
            at java.lang.Thread.run(Unknown Source) [?:1.8.0_91]
    Caused by: java.lang.NoClassDefFoundError: me/AdityaTD/TitlesAPI/TitlesAPI
            at me.webcrafter.ethant.Main.onPlayerJoin(Main.java:21) ~[?:?]
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_91]
            at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_91]
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_91]
            at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_91]
            at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:306) ~[spigot.jar:git-Spigot-db6de12-18fbb24]
            ... 14 more
    Caused by: java.lang.ClassNotFoundException: me.AdityaTD.TitlesAPI.TitlesAPI
            at java.net.URLClassLoader.findClass(Unknown Source) ~[?:1.8.0_91]
            at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:101) ~[spigot.jar:git-Spigot-db6de12-18fbb24]
            at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:86) ~[spigot.jar:git-Spigot-db6de12-18fbb24]
            at java.lang.ClassLoader.loadClass(Unknown Source) ~[?:1.8.0_91]
            at java.lang.ClassLoader.loadClass(Unknown Source) ~[?:1.8.0_91]
            at me.webcrafter.ethant.Main.onPlayerJoin(Main.java:21) ~[?:?]
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_91]
            at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_91]
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_91]
            at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_91]
            at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:306) ~[spigot.jar:git-Spigot-db6de12-18fbb24]
            ... 14 more
    and My source code is
    Code:
    package me.webcrafter.ethant;
    import me.AdityaTD.TitlesAPI.TitlesAPI;
    import org.bukkit.Bukkit;
    import org.bukkit.ChatColor;
    import org.bukkit.event.EventHandler;
    import org.bukkit.event.Listener;
    import org.bukkit.event.player.PlayerJoinEvent;
    import org.bukkit.plugin.java.JavaPlugin;
    public class Main extends JavaPlugin implements Listener {
            @Override
            public void onEnable() {
                    Bukkit.getServer().getPluginManager().registerEvents(this, this);
            }
          
            @EventHandler
            public void onPlayerJoin(PlayerJoinEvent e) {
                    TitlesAPI.sendTitle(e.getPlayer(), 20, 5 * 20, 10, ChatColor.RED + "Entities Server", "Welcome! Please enjoy your time here.");
                    TitlesAPI.sendTabTitle(e.getPlayer(), "Players Online:", "Tell your friends!");
            }
    }
     
  2. Offline

    timtower Administrator Administrator Moderator

    Moved to plugin development.
    @ethant Install and depend on that API
     
  3. Offline

    ethant

    What do you mean?
     
  4. Offline

    timtower Administrator Administrator Moderator

    @ethant You didn't install the TitleAPI on the server.
    It can't find the classes from it.
     
  5. Offline

    ethant

    Last edited by a moderator: Jun 4, 2016
  6. Offline

    timtower Administrator Administrator Moderator

    @ethant Did you install it? Are you building with the same API? Did you add depend: [pluginname] to your plugin.yml?
     
  7. Offline

    ethant

    I am using the same version and Yes I installed it but Im not sure what depend: is
     
  8. Offline

    timtower Administrator Administrator Moderator

    That tells Bukkit to load the other plugin before yours gets loaded.
     
  9. Offline

    ethant

    It Still doesnt wan to work not to sure what Im doing wrong
     
  10. Offline

    timtower Administrator Administrator Moderator

    Please post your full server log using http://pastebin.com
    And your plugin.yml using code blocks.
     
  11. Offline

    ethant

  12. Offline

    timtower Administrator Administrator Moderator

    @ethant Neither of the things that I asked for.
     
  13. Offline

    Betagear

    @ethant That isn't the server log, it's the source code...
     
Thread Status:
Not open for further replies.

Share This Page