Server Switch Packet

Info

Available for LabyMod users with version greater than 3.4.0

Overview

With our server switch packet you can send LabyMod users between different servers. The server can request a user to directly connect to a different IP address (or domain name). This can be used to create multi-server-networks. As this does not need any extra proxy software and hardware, it is generally cheaper for a network to connect players directly to the servers instead of using an intermediate software like BungeeCord.

Requirements

example switch packet

Example code

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
public void sendClientToServer( Player player, String title, String address, boolean preview ) {

    JsonObject object = new JsonObject();
    object.addProperty( "title", title ); // Title of the warning
    object.addProperty( "address", address ); // Destination server address
    object.addProperty( "preview", preview ); // Display the server icon, motd and user count

    // Send to LabyMod using the API
    LabyModPlugin.getInstance().sendServerMessage( player, "server_switch", object );
}

Info

You can use Minecraft color codes in the title (Example: &c)

Client response

Message key: server_switch

1
2
3
4
{
    "address": "play.hypixel.net",
    "accepted": true
}