Skip to main content

Plugin API (Java SDK)

This guide describes the Goxy Plugin API - a Java library you embed in your Bukkit/Spigot/Paper/Velocity plugin to integrate with the Goxy network from inside the game server.

↔️Looking for the HTTP API?

This page covers the in-process Java SDK for Minecraft plugin developers. If you want to talk to Goxy from an external service (website, dashboard, bot, etc.) over HTTP, see the Goxy HTTP API.

⚙️Expand Your Capabilities

With the Goxy API, you can create custom plugins that communicate with the network and extend its functionality.

Adding Dependencies​

The first step is to add goxy-api as a dependency to your plugin project.

repositories {
maven {
url "https://repo.goxy.pl"
}
}

dependencies {
compileOnly "pl.goxy.minecraft:goxy-api:1.11.4"
}

Configuring plugin.yml​

To ensure your plugin loads after Goxy, add a dependency in the plugin.yml file:

softdepend:
- "goxy"

or, if Goxy is required for your plugin to function:

depend:
- "goxy"
ℹ️Tip

Use softdepend if your plugin can function without Goxy, or depend if Goxy is required for proper operation.

Documentation and Source Code​

The Goxy plugin source code is open source and publicly available. You can review its structure and use ready-made examples.

📚Code Repository

Source code and Javadoc: 👉 gitlab.com/goxy.pl/minecraft/goxy-plugin

Example API Capabilities​

With the Goxy API, you can:

  • Transfer players between servers,
  • Check the status of servers in the network,
  • Send and receive data between plugins,
  • Respond to real-time events.
🚀Advanced Capabilities

The Goxy API enables the creation of complex communication and automation systems within your Minecraft network.

Example Code Usage​

The following example shows how to transfer a player to another server using the Goxy API:

public final class GoxyTransfer extends JavaPlugin implements CommandExecutor {

@Override
public void onEnable() {
getCommand("goxytransfer").setExecutor(this);
getServer().getMessenger().registerOutgoingPluginChannel(this, "BungeeCord");
getLogger().info("GoxyTransfer enabled! Use /goxytransfer <player> <server_id>");
}

@Override
public void onDisable() {
getServer().getMessenger().unregisterOutgoingPluginChannel(this, "BungeeCord");
getLogger().info("GoxyTransfer disabled!");
}

@Override
public boolean onCommand(@NotNull CommandSender sender, @NotNull Command command, @NotNull String label, String[] args) {
if (args.length != 2) {
sender.sendMessage("Usage: /goxytransfer <player> <server_id>");
return true;
}

Player targetPlayer = Bukkit.getPlayer(args[0]);
if (targetPlayer == null) {
sender.sendMessage("Player " + args[0] + " is not online!");
return true;
}
String serverId = args[1];
ByteArrayOutputStream b = new ByteArrayOutputStream();
DataOutputStream out = new DataOutputStream(b);
try {
out.writeUTF("Connect");
out.writeUTF(serverId);
} catch (IOException e) {
sender.sendMessage("Error while preparing transfer: " + e.getMessage());
return true;
}

targetPlayer.sendPluginMessage(this, "BungeeCord", b.toByteArray());
sender.sendMessage("Transferring player " + targetPlayer.getName() + " to server " + serverId + "...");

return true;
}
}
💡Works with Paper, Spigot, and Velocity

The Goxy API is compatible with most popular Minecraft server engines.

⚡ Easy Integration

Add the Goxy API to your plugin and connect to the network in seconds.

🔧 Full Control

Access methods to manage players and servers.

🚀 Open Source

Review the source code and use ready-made examples.

🌐 Our website is available at goxy.io
🖥️ Goxy dashboard is available here
⏳ Suspect a breakdown? Check our status page
💬 Want more about Goxy? Head to Discord
🤩 Look at the awesome curated list
📘 Read the API documentation

📦 API repository: gitlab.com/goxy.pl/minecraft/goxy-plugin

🎉 Create Your Own Plugin with the Goxy API!

Expand your Minecraft network's capabilities and automate server management!

REGISTER FOR FREE