Skip to content

Tablist

Server banner

Info

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

Add a custom image above the tablist on your server.

The banner is server bound and can't be changed by sending multiple packets.
The user has to reconnect to update the image.

The banner is url bound since version 3.8.25
Be aware that loading multiple banners can affect the performance of the client. We recommend not to use too many banners in one game session.

tablist banner

The size ratio of the image must be 5:1. The recommended scale is 1280x256 pixels.

Example code

public void sendServerBanner(Player player, String imageUrl) {
    JsonObject object = new JsonObject();
    object.addProperty("url", imageUrl); // Url of the image
    LabyModProtocol.sendLabyModMessage(player, "server_banner", object);
}

Language flag

Info

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

Overview

It is possible to add a language flag next to the player name in the tablist.
The server can choose which flag to display.

language flag

Example code

public void sendFlag(Player receiver, UUID uuid, String countryCode) {
    JsonObject flagPacket = new JsonObject();

    // Create array
    JsonArray users = new JsonArray();

    // Add user to array
    JsonObject userObject = new JsonObject();
    userObject.addProperty("uuid", uuid.toString()); // UUID of the flag player
    userObject.addProperty("code", countryCode); // The country code (e.g. "us", "de")
    users.add(userObject);

    // Add array to flag object packet
    flagPacket.add("users", users);

    LabyModProtocol.sendLabyModMessage(receiver, "language_flag", flagPacket);
}

User cache

Warning

Not available in LabyMod 4!

Overview

LabyMod has a cache for the player tab-list. If you want to spawn a NPC, you have to add it to the tab-list to make it visible and remove it again to keep the tab-list clean. With LabyMod you can add the NPC to the tab-list and remove it in the same tick again. The client will remember the information and use it when you spawn the actual Player entity.

Hide a player in the tablist

If the ping is set to -42, then the player is not displayed in the tab list.

Example video

In the video you can see that the server removes the NPC-names in the tab-list and then the actual NPC-entities appears. If you try to reproduce this in vanilla Minecraft, you will see that the skins of the NPC's are not loaded after turning around.

Disable the feature

You can disable this feature since LabyMod 3.8.0 using the protocol key tablist_cache with the following content:

{
    "enabled": false
}

Warning

This feature is enabled by default, it is not necessary to enable it manually! The cache will be cleared when you send this packet! So don't send this packet if you don't want to clear the tablist cache!

Warning

Be careful not to accidentally spawn the player in your game mode without using the tab-list, because with LabyMod the player becomes visible anyway.