Register a channel?

Discussion in 'BungeeCord Discussion' started by Suraski, May 29, 2013.

  1. I'm attempting to write a plugin that when a command is ran, it broadcasts something across the bungee servers within a config. Well I have everything done correctly and working, except for this error that pops up each time I go to send the plugin message. I've done it following a few tutorials on how the bungee API works and alas no luck...


    Error:

    Code (Text):

    20:06:35 [SEVERE] null
    org.bukkit.command.CommandException: Unhandled exception executing command 'test' in plugin BungeeBroadcast v1.0.0
            at org.bukkit.command.PluginCommand.execute(PluginCommand.java:46)
            at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:189)
            at org.bukkit.craftbukkit.v1_5_R3.CraftServer.dispatchCommand(CraftServer.java:546)
            at net.minecraft.server.v1_5_R3.PlayerConnection.handleCommand(PlayerConnection.java:979)
            at net.minecraft.server.v1_5_R3.PlayerConnection.chat(PlayerConnection.java:895)
            at net.minecraft.server.v1_5_R3.PlayerConnection.a(PlayerConnection.java:840)
            at net.minecraft.server.v1_5_R3.Packet3Chat.handle(Packet3Chat.java:44)
            at org.spigotmc.netty.NettyNetworkManager.b(NettyNetworkManager.java:187)
            at net.minecraft.server.v1_5_R3.PlayerConnection.d(PlayerConnection.java:109)
            at net.minecraft.server.v1_5_R3.ServerConnection.b(SourceFile:35)
            at org.spigotmc.MultiplexingServerConnection.b(MultiplexingServerConnection.java:72)
            at net.minecraft.server.v1_5_R3.MinecraftServer.r(MinecraftServer.java:583)
            at net.minecraft.server.v1_5_R3.DedicatedServer.r(DedicatedServer.java:227)
            at net.minecraft.server.v1_5_R3.MinecraftServer.q(MinecraftServer.java:472)
            at net.minecraft.server.v1_5_R3.MinecraftServer.run(MinecraftServer.java:404)
            at net.minecraft.server.v1_5_R3.ThreadServerApplication.run(SourceFile:573)
    Caused by: org.bukkit.plugin.messaging.ChannelNotRegisteredException: Attempted to send a plugin message through an unregistered channel ('BungeeCord'.
            at org.bukkit.plugin.messaging.StandardMessenger.validatePluginMessage(StandardMessenger.java:469)
            at org.bukkit.craftbukkit.v1_5_R3.entity.CraftPlayer.sendPluginMessage(CraftPlayer.java:818)
            at com.robbyduke.plugins.bungee.broadcast.Main.onCommand(Main.java:62)
            at org.bukkit.command.PluginCommand.execute(PluginCommand.java:44)
            ... 15 more
     
    Code:
    http://pastebin.com/Kx7AVaFk
     
    #1 Suraski, May 29, 2013
    Last edited: May 29, 2013
  2. getServer().getMessenger().registerOutgoingPluginChannel(this, "BungeeCord");
     
    • Agree x 1
    • Winner x 1
    • Informative x 1
    • Friendly x 1
    • Useful x 1
  3. Oh, hello! Thanks! Works now :)
     
  4. Thanks still playing minecraft 7 years old ;0