Danger

The Adventure docs are currently a work in progress and supplement the Javadocs. Some areas may have limited coverage or may not be entirely up to date. Feel free to join our Discord if you have any questions.

PlayerList/Tablist#

Adventure only supports changing the header (above the players) and footer (below the players) of the tablist.

Image showing a tablist from a multiplayer server with the header and footer encased, shown through the vanilla Minecraft client

Usage

With any Audience use Audience.sendPlayerListHeader(Component), Audience.sendPlayerListFooter(Component) and/or Audience.sendPlayerListHeaderAndFooter(Component, Component).

Whether sending a header or footer by itself will display another existing header or footer will vary depending on which platform you are working on. Servers will most likely support keeping headers or footers when sending them separately, while proxies are more likely to only let you send everything at once.

Examples

public void onPlayerJoin(final Audience player) {
    final Component header = Component.text("My Cool Server", NamedTextColor.BLUE);
    final Component footer = Component.text("It is: today!");
    player.sendPlayerListHeaderAndFooter(header, footer);
}

Depending on your platform this next example might display an existing header as well

public void onDayChange(final Audience server) {
    final Component footer = Component.text("It is: tomorrow!");
    server.sendPlayerListFooter(footer);
}