Playing gamemode

Info

Available for LabyMod users with version greater than 3.4.9

Overview

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

example gamemode

Requirements

Example code

1
2
3
4
5
6
7
8
public void sendCurrentPlayingGamemode( Player receiver, 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
    LabyModPlugin.getInstance().sendServerMessage( player, "server_gamemode", object );
}