Bungee Cord Plugin Tutorial

Discussion in 'BungeeCord Plugin Development' started by x128, Sep 1, 2013.

  1. Is there a reason that no BungeeCord plugin tutorials exist? I'm talking about plugins for the proxy. I'd really like to know how to create a command and make it send users to a server in a custom plugin. If anyone could point me in the right direction I would be very grateful!

    Also, I have been working with Bukkit plugin development for quite a while, so I'm not a total noob. Just a noob to Bungee development :p
  2. You want to create a command to get from one server to another? That can be done with bukkit. Look here:


    as zh32 said:

    Code (Java):
    Player p = //The player you want to connect to another server
    ByteArrayOutputStream b = new ByteArrayOutputStream();
    DataOutputStream out = new DataOutputStream(b);
    try {
    out.writeUTF("lobby"); // Name of the server to connect to
    } catch (IOException eee) { }
    p.sendPluginMessage(pbgame.plugin, "BungeeCord", b.toByteArray());

    You also have to register the outgoing plugin channel, like so:

    Code (Java):
    getServer().getMessenger().registerOutgoingPluginChannel(this, "BungeeCord");
    #2 Domi381, Sep 1, 2013
    Last edited: Sep 1, 2013
  3. BungeeCord- and Bukkitplugins are pretty much the same. Just read the source/javadoc to know how write a BungeeCord plugin.

    He is asking for bungee development, not bukkit.
  4. joehot200


    Link me to that please, cant seem to find it.
    • Agree Agree x 1
  5. He wanted to know how to connect a player to a specific server. And that is how to do it even with bukkit. So its even better for him, because he doesnt need to get into bungee cord.
  6. I can't remember the link, but you could generate the docs by yourself or just read the source code on github.
    EDIT: http://bungee-javadoc.tk/

    He said he wants to write BUNGEE plugin to send a player to another server....
    #6 zh32, Sep 1, 2013
    Last edited: Sep 1, 2013
  7. I just realized that you are the person that you quoted and that you are also speaking german. So: Schön einen Deutschen zu treffen :D
  8. joehot200


    if (thread.isArguing()) thread.setReported(true);
    • Funny Funny x 1
  9. Does anyone have an example BungeeCord plugin code I could take a look at? I'm completely lost with this.
    • Agree Agree x 1
  10. https://github.com/zh32/BungeeEx :p
    • Friendly Friendly x 2

  11. Thanks for that! I got the basic portion of my plugin setup. Now how do I forward the player to a server?
    • Agree Agree x 1
    • Useful Useful x 1