Skip to content

Server Switch Packet

Info

Available for LabyMod users with version greater than 3.4.0 (LabyMod 4 included)

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

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
    LabyModProtocol.sendLabyModMessage( player, "server_switch", object );
}

Info

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

Client response

Message key: server_switch

{
    "address": "play.hypixel.net",
    "accepted": true
}