Create your first BungeeCord plugin (Proxy)

Jul 1, 2021
Create your first BungeeCord plugin (Proxy)
  • Creating your first BungeeCord plugin

    How to get started with creating plugins

    Congratulations on deciding to create your first BungeeCord plugin! This tutorial will get you up to speed with the basics.

    Java knowledge is required for this tutorial.

    Setting up your Project(top)

    This tutorial only covers IntelliJ IDEA, but other IDEs should have similar steps.
    Edit by kodalee: Added screenshots from the "Eclipse" IDE.

    First, open your IDE and create a new project, and then select Maven. You should have a screen similar to this:
    Creating a new project:
    Selecting Maven:

    Click next, then you will get this screen:
    For GroupId, type in your Java package name (like me.username). For ArtifactId, type in the name of your plugin (in our case, it will be TestPlugin). Leave the version alone for now, and click next. Change the name of your project to the name of your plugin, and then click "Finish".

    The IDE will open and show you a file called pom.xml. We will now add some content to this file. Add the following lines to it, before </project>:
    You will need to put the dependency from <dependencies> from the given code below into the <dependencies> area that is in your pom.xml.

    No idea why it does that but it might be required to edit on Eclipse.

    Code (XML):


    This will add the BungeeCord dependency to your project. If you are using IDEA, it will ask if you want to import changes from the pom.xml file. Import them. If it asks about the language level being changed, allow it to reload the project.

    Creating your main class(top)

    Next, expand TestPlugin, then src, then main. It should look like this:

    Right click java, then make a new package. Call it me.username.testplugin. Next, right-click the package you just created and make a new class. Call it TestPlugin. The IDE should have opened the file for you; if it did not do so, open it now.

    Now, we can create our basic plugin. This page will only focus on making a plugin that does nothing except display a message when enabled; other pages on the wiki can detail all the other things you can do with your new plugin.

    Add extends Plugin after the TestPlugin and before the {. The file should look something like this:

    Code (Java):
    package me.username.testplugin;

    import net.md_5.bungee.api.plugin.Plugin;

    public class TestPlugin extends Plugin {
        public void onEnable() {
            // You should not put an enable message in your plugin.
            // BungeeCord already does so
            getLogger().info("Yay! It loads!");

    Making it load(top)

    Now we can create the plugin.yml file, so that BungeeCord recognizes that this is a plugin and tell it how to load it. Right click resources, and create a new file called plugin.yml. In this file, add the following:

    Code (YAML):
    name: TestPlugin
    : me.username.testplugin.TestPlugin
    : 1.0
    : username
    You can also create a bungee.yml file if plugin.yml is already loaded by Bukkit.


    We are almost done. It is now time to compile the plugin. Expand the Maven Projects pane on the right (If you don't see it, click on View and then on Tool Buttons), expand your project, expand Lifecycle, double-click clean, and double-click package. Maven will now compile your project. Now, open your project's folder, and look in target for your plugin. Install it on your BungeeCord instance and start it. If a line like [INFO] Enabled plugin TestPlugin version 1.0 by username appears, it worked, and you have created your first BungeeCord plugin! To recompile it, repeat these instructions.

    For Bukkit Developers(top)

    If you are a Bukkit developer, and anything seems remarkably familiar to you, it is because the BungeeCord API was heavily inspired by the Bukkit API. Many of the concepts (EventHandlers and Schedulers) remain the same, and some class and method names are the same.
  • Loading...
  • Loading...