TablistListener intercepts and formats the header and footer of the player list (tab list). This allows servers to display formatted information above and below the player list with MiniMessage formatting and placeholder support.
Packet Type
Intercepts:PacketType.Play.Server.PLAYER_LIST_HEADER_AND_FOOTER
This packet is sent when the server updates the tab list header or footer.
Configuration
Class Structure
Implementation Details
1. Packet Type Validation
- The listener is disabled in the configuration
- The packet type doesn’t match
PLAYER_LIST_HEADER_AND_FOOTER
2. Header and Footer Processing
ProcessHandler.processComponent(), which:
- Resolves PlaceholderAPI placeholders
- Resolves MiniPlaceholders
- Parses MiniMessage formatting
- Returns formatted Adventure
Componentobjects
Usage Example
When a plugin sets the tab list:- Intercept the header and footer packets
- Process MiniMessage formatting for the gradient
- Resolve
%server_online%and%server_max%placeholders - Send the formatted components to the client
- Header: Displays “Server Name” with a gold-to-yellow gradient
- Footer: Shows current player count like “Players: 15/100”
Processing Order
The footer is processed before the header in the implementation, but this order doesn’t affect the visual result since both are sent in the same packet.
Per-Player Formatting
Since the processing includes theplayer parameter, each player can see personalized tab list content:
Dependencies
- PacketEvents: For packet interception
- WrapperPlayServerPlayerListHeaderAndFooter: Packet wrapper for reading/modifying tab list
- ProcessHandler: For placeholder resolution and formatting
Related Components
- ProcessHandler - Handles text processing
- ConfigManager - Manages listener configuration
Common Use Cases
-
Server Information Display
- Show server name, website, Discord link
- Display current game mode or event information
-
Player Statistics
- Show player count, ping, TPS
- Display player-specific stats like rank, balance, playtime
-
Dynamic Updates
- Real-time event countdowns
- Rotating tips or announcements
- Live server status indicators