Solved Need help! PlayerJoinEvent Error!

Discussion in 'Plugin Help/Development/Requests' started by DutchFragile, Jan 27, 2015.

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

    DutchFragile

    Hello, i was making a simple plugin. (Sorry for my bad English im Dutch)
    it's an BarAPI, but when i run it i have a error.

    Code:
    [14:33:18 ERROR]: Could not pass event PlayerJoinEvent to BossBar v1.0
    org.bukkit.event.EventException
            at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.ja
    va:299) ~[spigot-1.7.9-R0.3-SNAPSHOT.jar:git-Spigot-1543]
            at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.jav
    a:62) ~[spigot-1.7.9-R0.3-SNAPSHOT.jar:git-Spigot-1543]
            at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.j
    ava:502) [spigot-1.7.9-R0.3-SNAPSHOT.jar:git-Spigot-1543]
            at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.j
    ava:487) [spigot-1.7.9-R0.3-SNAPSHOT.jar:git-Spigot-1543]
            at net.minecraft.server.v1_7_R3.PlayerList.c(PlayerList.java:265) [spigo
    t-1.7.9-R0.3-SNAPSHOT.jar:git-Spigot-1543]
            at net.minecraft.server.v1_7_R3.PlayerList.a(PlayerList.java:152) [spigo
    t-1.7.9-R0.3-SNAPSHOT.jar:git-Spigot-1543]
            at net.minecraft.server.v1_7_R3.LoginListener.c(LoginListener.java:105)
    [spigot-1.7.9-R0.3-SNAPSHOT.jar:git-Spigot-1543]
            at net.minecraft.server.v1_7_R3.LoginListener.a(LoginListener.java:43) [
    spigot-1.7.9-R0.3-SNAPSHOT.jar:git-Spigot-1543]
            at net.minecraft.server.v1_7_R3.NetworkManager.a(NetworkManager.java:187
    ) [spigot-1.7.9-R0.3-SNAPSHOT.jar:git-Spigot-1543]
            at net.minecraft.server.v1_7_R3.ServerConnection.c(ServerConnection.java
    :81) [spigot-1.7.9-R0.3-SNAPSHOT.jar:git-Spigot-1543]
            at net.minecraft.server.v1_7_R3.MinecraftServer.v(MinecraftServer.java:7
    31) [spigot-1.7.9-R0.3-SNAPSHOT.jar:git-Spigot-1543]
            at net.minecraft.server.v1_7_R3.DedicatedServer.v(DedicatedServer.java:2
    84) [spigot-1.7.9-R0.3-SNAPSHOT.jar:git-Spigot-1543]
            at net.minecraft.server.v1_7_R3.MinecraftServer.u(MinecraftServer.java:5
    84) [spigot-1.7.9-R0.3-SNAPSHOT.jar:git-Spigot-1543]
            at net.minecraft.server.v1_7_R3.MinecraftServer.run(MinecraftServer.java
    :490) [spigot-1.7.9-R0.3-SNAPSHOT.jar:git-Spigot-1543]
            at net.minecraft.server.v1_7_R3.ThreadServerApplication.run(SourceFile:6
    28) [spigot-1.7.9-R0.3-SNAPSHOT.jar:git-Spigot-1543]
    Caused by: java.lang.NoClassDefFoundError: me/confuser/barapi/BarAPI
            at me.dutchfragile.boss.Boss.onJoin(Boss.java:23) ~[?:?]
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0
    _11]
            at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0
    _11]
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1
    .8.0_11]
            at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_11]
            at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.ja
    va:296) ~[spigot-1.7.9-R0.3-SNAPSHOT.jar:git-Spigot-1543]
            ... 14 more
    Caused by: java.lang.ClassNotFoundException: me.confuser.barapi.BarAPI
            at java.net.URLClassLoader$1.run(Unknown Source) ~[?:1.8.0_11]
            at java.net.URLClassLoader$1.run(Unknown Source) ~[?:1.8.0_11]
            at java.security.AccessController.doPrivileged(Native Method) ~[?:1.8.0_
    11]
            at java.net.URLClassLoader.findClass(Unknown Source) ~[?:1.8.0_11]
            at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.
    java:77) ~[spigot-1.7.9-R0.3-SNAPSHOT.jar:git-Spigot-1543]
            at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.
    java:62) ~[spigot-1.7.9-R0.3-SNAPSHOT.jar:git-Spigot-1543]
            at java.lang.ClassLoader.loadClass(Unknown Source) ~[?:1.8.0_11]
            at java.lang.ClassLoader.loadClass(Unknown Source) ~[?:1.8.0_11]
            at me.dutchfragile.boss.Boss.onJoin(Boss.java:23) ~[?:?]
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0
    _11]
            at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0
    _11]
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1
    .8.0_11]
            at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_11]
            at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.ja
    va:296) ~[spigot-1.7.9-R0.3-SNAPSHOT.jar:git-Spigot-1543]
            ... 14 more


    This is the source:

    Code:
    package me.dutchfragile.boss;
    
    import me.confuser.barapi.BarAPI;
    
    import org.bukkit.ChatColor;
    import org.bukkit.entity.Player;
    import org.bukkit.event.EventHandler;
    import org.bukkit.event.Listener;
    import org.bukkit.event.player.PlayerJoinEvent;
    import org.bukkit.plugin.PluginManager;
    import org.bukkit.plugin.java.JavaPlugin;
    
    public class Boss extends JavaPlugin implements Listener {
       
        public void onEnable() {
            PluginManager pm = getServer().getPluginManager();
            pm.registerEvents(this, this);
        }
       
        @EventHandler
        public void onJoin(PlayerJoinEvent e) {
            Player p = (Player) e.getPlayer();
            BarAPI.setMessage(p, ChatColor.AQUA + "Welcome to the server" +  p.getPlayerListName());
        }
    
    }
    
    Greetz,

    DutchFragile
     
  2. Offline

    mythbusterma

    @DutchFragile

    BarAPI is not running on your server. Either it is not there or cannot load.
     
    Konato_K and GrandmaJam like this.
  3. Offline

    DutchFragile

    Wow, i was so dumb, barAPI was not running on my server, thanks for the help!
     
    GrandmaJam likes this.
  4. @DutchFragile I'm glad that your problem was solved. :) Please set the prefix to "Solved" under Thread Tools > Prefix > Solved.
     
Thread Status:
Not open for further replies.

Share This Page