Solved Bungeecord connect, why Error?

Discussion in 'Spigot Plugin Development' started by ashStranger, Jun 3, 2018.

  1. Bungeecord connect, Error, How I to do?

    Code (Java):

    // authme
    @EventHandler
        public void inlogin(LoginEvent e) {
    ...
    ProxiedPlayer player = (ProxiedPlayer) e.getPlayer();
    e.getPlayer().sendMessage(new ComponentBuilder("§aGo Go Go").create());
    ServerInfo target = ProxyServer.getInstance().getServerInfo("hub");
    player.connect(target);
    ...
    }
     
    Code (error (Unknown Language)):

    [16:41:22] [Server thread/WARN]: [iLogin] Task #40 for iLogin v0.0.1 generated an exception
    java.lang.NoClassDefFoundError: net/md_5/bungee/api/connection/ProxiedPlayer
        at cn.gamemc.iLogin.event.login$1$1.run(login.java:44) ~[?:?]
        at org.bukkit.craftbukkit.v1_11_R1.scheduler.CraftTask.run(CraftTask.java:58) ~[paper1112.jar:git-Paper-1040]
        at org.bukkit.craftbukkit.v1_11_R1.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:355) [paper1112.jar:git-Paper-1040]
        at net.minecraft.server.v1_11_R1.MinecraftServer.D(MinecraftServer.java:811) [paper1112.jar:git-Paper-1040]
        at net.minecraft.server.v1_11_R1.DedicatedServer.D(DedicatedServer.java:403) [paper1112.jar:git-Paper-1040]
        at net.minecraft.server.v1_11_R1.MinecraftServer.C(MinecraftServer.java:749) [paper1112.jar:git-Paper-1040]
        at net.minecraft.server.v1_11_R1.MinecraftServer.run(MinecraftServer.java:648) [paper1112.jar:git-Paper-1040]
        at java.lang.Thread.run(Thread.java:748) [?:1.8.0_151]
    Caused by: java.lang.ClassNotFoundException: net.md_5.bungee.api.connection.ProxiedPlayer
        at java.net.URLClassLoader.findClass(URLClassLoader.java:381) ~[?:1.8.0_151]
        at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:102) ~[paper1112.jar:git-Paper-1040]
        at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:87) ~[paper1112.jar:git-Paper-1040]
        at java.lang.ClassLoader.loadClass(ClassLoader.java:424) ~[?:1.8.0_151]
        at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ~[?:1.8.0_151]
        ... 8 more
     
     
    • Funny Funny x 1
  2. Is your Plugin on a BungeeCord-Server enabled?
     
  3. 在LoginEvent時玩家還沒有正式進入
    所以根據 https://www.spigotmc.org/wiki/event-api/
    你應該使用PostLoginEvent
    還有你的插件應該是Bungeecord的 這裏是for Spigot XD
     
  4. Bukkit can't read BungeeCord-Plugins. Move your BungeeCordPlugin on a BungeeCord-Server.

    Exception: ClassNotFoundException
     
    • Winner Winner x 2
  5. ohhhh u are right, sorry my bad
    thats the reason :L

    Add-on:
    He means u are coding a bungeecord plugin, proxiedplayer is for bungee only, u cant put
    bungee plugin into spigot server XD
     
    • Agree Agree x 1
  6. I want to use spigot. What should I do?

    我想用到spigot,该怎么做?

    在spigot连接其它服(BungeeCord其它spigot服)
     
  7. I want to use spigot. What should I do?
     
  8. 就像以上所說 你應該要用到一個叫做Plugin-Messaging-Channel的東西, 當你的伺服器連接了BungeeCord 並且玩家是由BungeeCord進入,你可以註冊一個Out Going Channel,然後用字符控制玩家在伺服器之間傳送,上一樓所說的連接有很多解釋
     
  9. 好的,谢谢大家的回复
    我勉强看懂,已经会用了
     
  10. 記得可以轉成 "Resloved" ;)
     
    • Agree Agree x 1
  11. Ah, yes, somebody who can read errors and understand them :D Just like me. Sometimes.