> ## Documentation Index
> Fetch the complete documentation index at: https://new-docs.simplecloud.app/llms.txt
> Use this file to discover all available pages before exploring further.

# Start with BungeeCord

> Implementing the SimpleCloud Controller API in BungeeCord

## Getting Started

The following guide will show you how to implement our API in your BungeeCord plugin.

Our API includes the `ControllerApi` and the `PlayerApi` class. The `ControllerApi` is used to interact with SimpleCloud's [groups](/en/manual/setup/groups), [servers](/en/manual/setup/servers), and more, while the `PlayerApi` is used to interact with [players](/en/manual/droplet/player).

## Dependencies

First, we need to add the dependencies to your `build.gradle` or `pom.xml`:

<Tabs>
  <Tab title="Gradle (Kotlin)">
    ```kotlin theme={null}
    repositories {
        maven("https://repo.simplecloud.app/snapshots")
        maven("https://buf.build/gen/maven")
        maven("https://oss.sonatype.org/content/repositories/snapshots/")
    }

    dependencies {
        compileOnly("app.simplecloud.api.platform:bungeecord:LATEST")
        compileOnly("net.md-5:bungeecord-api:1.20-R0.1-SNAPSHOT")
    }
    ```
  </Tab>

  <Tab title="Gradle (Groovy)">
    ```groovy theme={null}
    repositories {
        maven { url 'https://repo.simplecloud.app/snapshots' }
        maven { url 'https://buf.build/gen/maven' }
        maven { url 'https://oss.sonatype.org/content/repositories/snapshots/' }
    }

    dependencies {
        compileOnly 'app.simplecloud.api.platform:bungeecord:LATEST'
        compileOnly 'net.md-5:bungeecord-api:1.20-R0.1-SNAPSHOT'
    }
    ```
  </Tab>

  <Tab title="Maven">
    ```xml theme={null}
    <repositories>
        <repository>
            <id>simplecloud-snapshots</id>
            <url>https://repo.simplecloud.app/snapshots</url>
        </repository>
        <repository>
            <id>buf-maven</id>
            <url>https://buf.build/gen/maven</url>
        </repository>
        <repository>
            <id>sonatype</id>
            <url>https://oss.sonatype.org/content/repositories/snapshots/</url>
        </repository>
    </repositories>

    <dependencies>
        <dependency>
            <groupId>app.simplecloud.api.platform</groupId>
            <artifactId>bungeecord</artifactId>
            <version>LATEST</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>net.md-5</groupId>
            <artifactId>bungeecord-api</artifactId>
            <version>1.20-R0.1-SNAPSHOT</version>
            <scope>provided</scope>
        </dependency>
    </dependencies>
    ```
  </Tab>
</Tabs>

<Warning>
  Please don't compile our API into your plugin, just follow the next step, and
  depend on the API.
</Warning>

## Depend on the API

BungeeCord plugins can inherit from the SimpleCloud Cloud API plugin. This is useful if you want to use the SimpleCloud API in your plugin.

For this, you need to add a `depend` configuration to your `plugin.yml` file. Here is an example:

```yaml theme={null}
name: simplecloud-example-bungeecord
version: 1.0.0
main: app.simplecloud.examples.plugin.bungeecord.BungeeCordExamplePlugin
depend: [simplecloud-api]
```

After that, you can use the SimpleCloud API in your plugin:

<Tabs>
  <Tab title="Kotlin">
    ```kotlin theme={null}
    import app.simplecloud.controller.api.ControllerApi
    import kotlinx.coroutines.CoroutineScope
    import kotlinx.coroutines.Dispatchers
    import kotlinx.coroutines.launch
    import net.md_5.bungee.api.plugin.Plugin

    class BungeeCordExamplePlugin : Plugin() {

        private val controllerApi = ControllerApi.createCoroutineApi()

        override fun onEnable() {
            logger.info("Hello from BungeeCord!")

            CoroutineScope(Dispatchers.IO).launch {
                val groups = controllerApi.getGroups().getAllGroups()
                logger.info("Groups: $groups")
            }
        }

    }
    ```
  </Tab>

  <Tab title="Java">
    ```java theme={null}
    import app.simplecloud.controller.api.ControllerApi;
    import net.md_5.bungee.api.plugin.Plugin;

    public class BungeeCordExamplePlugin extends Plugin {

        private final ControllerApi.Future controllerApi = ControllerApi.createFutureApi();

        @Override
        public void onEnable() {
            getLogger().info("Hello from BungeeCord!");
            controllerApi.getGroups().getAllGroups().thenAccept(groups -> {
                getLogger().info("Groups: " + groups);
            });
        }

    }
    ```
  </Tab>
</Tabs>
