TDXDevelopment
TDX LeaderboardsConfiguration

milestones

First-time notifications when a player breaks into the top of a board.

A milestone is the "you made it" moment: the first time a player reaches a top position on a board, they get a message and a sound. It is a notification, not a reward. Prizes belong in rewards.

The whole block

plugins/TDXLeaderboards/config.yml
milestones:
  enabled: true
  threshold: 10
KeyTypeDefaultNotes
enabledbooleantrueMaster switch.
thresholdint10Positions from 1 to this number count as a milestone.

What fires, and how often

With threshold: 10, a player is notified the first time they reach each position from #10 up to #1 on each board. Reaching #7 on Ores Mined fires once. Reaching #3 later fires again, because that is a position they had not held before. Dropping back to #7 and returning does not.

Each of these is remembered permanently, per player, per board and per position. A period reset does not clear them, so next month the same player is not told again that they entered the top 10.

A position reached while the player is offline is still recorded, but there is nobody to tell, so that notification is skipped for good. This happens when other players drop off a board and push an offline player up.

The text and the sound

Both live in messages.yml:

KeyNotes
milestone-reachedThe message. Takes %player%, %board% and %position%.
milestone-soundSound played with it. Set it to "" for silence.

There are no commands on a milestone. If you want to hand out something the first time a player tops a board, use the PlayerRankChangeEvent from the API in your own plugin.

Clearing milestones

There is no command that clears them. The flags are stored in the milestone_flags table, and the only thing that empties it is starting on a fresh database.