Leaderboard Name Beautifier

A tool you can use to make the leaderboard names in ajLeaderboards more human-readable or, well, more beautiful

Defaults

leaderboard_name_beautifier:
    settings:
    enabled: true
    # true/false - Whether to capitalize after applying replacers
    # For example: "players killed" -> "Players Killed"
    capitalize_result_equals: false
    capitalize_result_contains: true
  replacers:
    # For these replacers to work, the board name must equal the matcher (case-sensitive)
    equals:
      # Name of the replacer
      walk:
        # What to match the board name with
        matcher: "statistic_walk_one_cm"
        # What to replace the matcher with
        replacement: "Cm walked"
      playtime:
        matcher: "statistic_minutes_played"
        replacement: "Playtime"
      balance:
        matcher: "vault_eco_balance"
        replacement: "Money"
    # For these replacers to work, the board name must contain the matcher
    contains:
      statistic:
        matcher: "statistic_"
        replacement: ""
      underscore:
        matcher: "_"
        replacement: " "
      colon:
        matcher: ":"
        replacement: ": "
        cut: true
        # This replacer section will only get applied if the "colon" replacement was successful
        # You can have as many nested if_match sections as you want
        if_match:
          comma:
            matcher: ","
            # Allows you to cut the board name until the matcher
            # For example: "kill_entity:ender_dragon,wither,warden,elder_guardian" -> "kill_entity:ender_dragon,"
            cut: true
            replacement: "..."

Tutorial

Here's a template from which you can make your own beautifiers

# ...
  equals:
    # This replacer replaces the leaderboard name "statistic_walk_one_cm" with "Walk distance in cm"
    walk:
      matcher: "statistic_walk_one_cm"
      replacement: "Walk distance in cm"
  contains:
    # This replacer essentially removes "player_" if the given leaderboard name contains it
    player:
      matcher: "player_"
      replacement: ""

Extras

You can use PlaceholderAPI placeholders in replacement values, which will be parsed from the perspective of the menu viewer

Last updated