TAB Minecraft Plugin Documentation

repository·master·Indexed 22 days ago

https://github.com/neznamy/tab

An all-in-one Minecraft plugin for displaying information, focusing on high performance and compatibility. Features include bossbar management (/tab bossbar), CPU usage tracking (/tab cpu), group management (/tab group), and diagnostic tools like /tab dump for exporting configuration and player data.

Tokens
7.1K
Snippets
30
Records
43
Agent score
76%

What's inside TAB

  1. Compile TAB from source

    master

    To compile the plugin manually, you must have JDK 25 or higher installed. Use the Gradle wrapper to build the project.

    After compilation, the resulting JAR file can be found in the /jar/build/libs/ directory. The universal JAR contains all modules for all supported platforms.

    ./gradlew build
  2. Handle TAB being disabled due to configuration errors

    master

    When the TAB plugin is disabled because of a broken configuration file, the plugin enters a 'disabled' state. In this state, the command processor behaves as follows:

    • For non-admin users: Most commands will result in no output or a permission error message.
    • For users with admin permissions: The plugin provides instructions on how to resolve the issue.
    • Reloading: If the configuration error is fixed, the plugin can be reloaded using the reload command (e.g., /tab reload), provided the user has the necessary reload permissions.
  3. Use the /tab group/player property command

    master

    The property command allows you to modify specific player attributes such as tab prefixes, suffixes, and tags.

    Syntax: /tab group/player <name> <property> <value...>

    Valid Properties:

    • tabprefix
    • customtabname
    • tabsuffix
    • tagprefix
    • tagsuffix

    Contextual Flags: When setting a value, you can optionally specify a target server or world using flags. Note that the implementation logic for parsing these flags is embedded in the command execution:

    • -w <world>: Specifies the target world.
    • -s <server>: Specifies the target server.

    Permissions: To change a specific property, you must have the permission node: tab.command.property.<property> (constructed as TabConstants.Permission.COMMAND_PROPERTY_CHANGE_PREFIX + property).

    /tab group/player <name> <property> <value...>
    
    Example usage for setting a tab prefix:
    /tab group/player Notch tabprefix &b[VIP]
  4. Use the dump command for debugging information

    master

    The /tab debug command has been deprecated and removed. To obtain debugging information, use the new dump command format: /<platform_command> dump <player>.

    Replace <platform_command> with the base command of your specific platform (e.g., /tab) and <player> with the target player's name.

    # Example usage (assuming the base command is /tab)
    /tab dump <player>
  5. View group settings with /tab group <group>

    master

    When running /tab group <group>, the command outputs a formatted summary of the group's configuration hierarchy:

    1. Global Settings: Properties applied to the group across all contexts.
    2. World Settings: Properties that override global settings for specific worlds (prefixed with &6World <world_name>:&e).
    3. Server Settings: Properties that override global settings for specific servers (prefixed with &3Server <server_name>:&b).

    This is useful for debugging why a player in a specific world or server is seeing certain TAB formatting.

  6. Manage server instances with the Server class

    master

    The Server class is a data model used to represent and manage server state and configuration within TAB. Instances are reused, meaning you can use identity comparison (==) to determine if two Server objects refer to the same server.

    To retrieve or create a server instance, use the byName(String name) method. If a server with the specified name does not exist, it will be created automatically.

    // Retrieve an existing server or create a new one by its name
    Server server = Server.byName("lobby");
    
    // Access the server name
    String name = server.getName();
  7. Configure Server properties

    master

    The Server class provides methods to manage its internal state:

    • markSpyServer(): Marks the server as a spy-server, allowing it to see all other servers in the global playerlist.
    • setServerGroup(ServerGroup serverGroup): Assigns the server to a specific ServerGroup. This is used to control visibility in the global playerlist (servers in the same group can see each other).
    • getName(): Returns the unique name of the server.
  8. Check server visibility with canSee()

    master

    The canSee(Server other) method determines if the current server instance can see another server in the global playerlist.

    Visibility logic depends on the configuration:

    • Spy-servers: If a server is marked as a spy-server (via markSpyServer()), it can see all other servers.
    • Server Groups: If global playerlist is enabled, non-spy servers can only see other servers that belong to the same ServerGroup.
    • Global Playerlist Disabled: If the global playerlist is disabled, a server can only 'see' itself.
    • Self-visibility: A server can always see itself.
    Server serverA = Server.byName("lobby");
    Server serverB = Server.byName("survival");
    
    if (serverA.canSee(serverB)) {
        // Logic for when serverA can see serverB in the playerlist
    }