Skip to content

Playing gamemode

Info

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

Overview

The LabyMod chat can display the name of the current gamemode on the server

example gamemode

Requirements

Example code

public void sendCurrentPlayingGamemode( Player player, boolean visible, String gamemodeName ) {
    JsonObject object = new JsonObject();
    object.addProperty( "show_gamemode", visible ); // Gamemode visible for everyone
    object.addProperty( "gamemode_name", gamemodeName ); // Name of the current playing gamemode

    // Send to LabyMod using the API
    LabyModProtocol.sendLabyModMessage( player, "server_gamemode", object );
}