TDXDevelopment
TDX LeaderboardsGuides

Add a custom board

Define a new leaderboard, give it its own rewards, and verify it shows up in the GUI.

In this guide you'll add a "Villager Trades" board that ranks players by how many trades they made this month, give the top three their own reward, and check that it shows up in the in-game GUI.

Pick a board type and a tracking mode

Trades are counted by vanilla, as the statistic TRADED_WITH_VILLAGER, so the board is type: STATISTIC. The vanilla number is a lifetime total, and we want this month's progress only, so the tracking mode is tracking: DELTA: the board shows how far the number has moved since the period began.

Only plain statistics work. Ones that need a block, item or mob, such as MINE_BLOCK, are not supported. The full list of types and modes is on the boards page.

Add the board to config.yml

Open plugins/TDXLeaderboards/config.yml and add an entry under boards:. The key you choose (villager-trades here) is the board's id, used in commands, placeholders and rewards.

plugins/TDXLeaderboards/config.yml
boards:
  villager-trades:
    enabled: true
    display-name: "<#5EEEA0><bold>Villager Trades</bold>"
    description: "Most trades made this month"
    material: EMERALD
    type: STATISTIC
    tracking: DELTA
    statistic: TRADED_WITH_VILLAGER
    value-format: "%value% trades"
    gui-slot: 43
    category: economy

gui-slot must be a slot no other board uses. In the shipped layout the free ones are 11, 13, 15, 19, 21, 23, 25, 29, 31, 33, 37 and 43. The outer ring of the menu is decoration, and slots 4, 49 and 50 hold the points, close and history buttons.

Add rewards for this board

Rewards for a single board go under rewards.board-rewards, keyed by the board id. The block ships commented out, so uncomment it or add it:

plugins/TDXLeaderboards/config.yml
rewards:
  board-rewards:
    villager-trades:
      1:
        commands:
          - "give %player% emerald_block 8"
          - "eco give %player% 5000"
        message: "<#5EEEA0>Top trader of the month! +8 emerald blocks, +$5k"
      2:
        commands:
          - "give %player% emerald_block 4"
        message: "<#A8D8F0>2nd place trader! +4 emerald blocks"
      3:
        commands:
          - "give %player% emerald_block 2"
        message: "<#A8D8F0>3rd place trader! +2 emerald blocks"

These are paid on top of the points leaderboard rewards when the period ends. %player% is the only placeholder, and an offline winner gets the commands on their next join but not the message. Details on the rewards page.

Reload and refresh

/lbadmin reload
/lbadmin update

reload re-reads config.yml, update recalculates every board now instead of waiting for the next update-interval.

Verify in-game

Run /leaderboard. The board should appear in slot 43 with an emerald icon, under the Economy tab. Trade with a villager a few times and run /lbadmin update again: your row shows the trades made since the board first saw you.

If the board does not show up, look in console for Failed to load board 'villager-trades' and the reason after it, for example Invalid statistic. /lbadmin debug lists every board that did load.

What to try next

  • Make it count double for a weekend event with points-multiplier: 2 on the board
  • Let milestones tell players the first time they break into its top 10. That needs no setup per board, it is on for every board
  • Put it on a hologram at spawn with /lbadmin hologram create trades villager-trades