Subtitles

Overview

The LabyMod client can display a subtitle tag (similar through using the scoreboard) under a players name.

example subtitle on timolia

Requirements

Example code

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
public void setSubtitle( Player receiver, UUID subtitlePlayer, String value ) {
    // List of all subtitles
    JsonArray array = new JsonArray();

    // Add subtitle
    JsonObject subtitle = new JsonObject();
    subtitle.addProperty( "uuid", subtitlePlayer.toString() );

    // Optional: Size of the subtitle
    subtitle.addProperty( "size", 0.8d ); // Range is 0.8 - 1.6 (1.6 is Minecraft default)

    // no value = remove the subtitle
    if(value != null)
        subtitle.addProperty( "value", value );

    // You can set multible subtitles in one packet
    array.add(subtitle);

    // Send to LabyMod using the API
    LabyModPlugin.getInstance().sendServerMessage( receiver, "account_subtitle", array );
}

Info

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