Ping formatting Sponge - montlikadani/TabList GitHub Wiki

Such operators, as conditional (logical) operators, are used for ping formatting to set different colors when, for example, the return value of ping is 240, so the player's network connection is in poor condition. This feature has only been added to add an additional feature to the plugin and to make some formal changes.

Conditional operators

Operator Explanation
== Tests that the return value is equal to the specified one
!= True if the two comparable value are not equal, false otherwise
< Compares two values, true if the first one is smaller than the second
<= Compares two values, true if the first one is smaller or equal the second
> Compares two values, true if the first one is greater than the second
>= Compares two values, true if the first one is greater or equal the second

Examples

placeholder-format {
    ping {
        formats=[
            "&a%player-ping% <= 200",
            "&6%player-ping% >= 400",
            "&c%player-ping% > 500"
        ]
    }
}

As shown in this example, it is necessary to specify the variable %player-ping% as a placeholder for the condition to be true if this return value of the placeholder is comparable to the value of the specified condition. Assuming that the return value of the %player-ping% placeholder is greater or equal to 400, the color will also change from green (&a) to gold (&6) because the ping is high.