Skip to main content

Developer API

This guide describes how to use the Goxy API, which enables the creation of custom plugins that integrate with the Goxy network and its features.

⚙️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

Check out the code and API documentation here: 👉 https://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

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;
}
}

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

💡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.

Links and Resources

🔗All in One Place

Key links for Goxy developers.

ResourceLink
API RepositoryGoxy API Repo
Homepagegoxy.io
Admin Paneldashboard.goxy.io
DiscordJoin the community
Service Statusstatus.goxy.io

🎉 Create Your Own Plugin with the Goxy API!

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

REGISTER FOR FREE