Milestones
On this page(15)
Milestones reward long-term play. Each category is a tab of /milestones that counts one stat, like swings or kills. It holds a fixed list of milestones (I, II, III...) with growing requirements. A player claims each milestone's rewards once, with a click or Claim All.
| Files | modules/milestones/config.yml, modules/milestones/categories/ (one file per category), modules/milestones/guis/menu.yml, modules/milestones/lang/messages_en.yml |
| Player command | /milestones (aliases /ms, /milestone) |
| Admin commands | /dungeons admin milestones ... |
| Switch | enabled: (first key of modules/milestones/config.yml) + /dungeons reload |
How it works
- A category counts one source. Its value comes from the core stats, so it keeps counting while the module is off.
- Milestones are climbed in order. A milestone counts as reached only once the one before it is reached.
- Reaching one tells the player with three chat lines, a sound and a title.
- Claiming runs the milestone's rewards once. When the list ends, nothing more happens.
Sources
| Source | What it counts |
|---|---|
swings | The swings of the zone mob fight. |
kills | The zone mobs killed. |
leveling:<track> | The highest level reached in a leveling track. A rebirth or a reset never lowers it. |
earned:<currency> | What the currency earned by playing: zone mob kills and enchants, with boosters. Never a give, a payment, a pouch or an admin change. |
milestones | The milestones completed in the categories of count:. |
A milestones category never counts itself or another category of that source. An admin change to a track level while the player is offline is not seen by leveling:<track>.
States
| State | Meaning |
|---|---|
| Locked | Not reached yet. |
| Claimable | Reached, not claimed. |
| Claimed | Its rewards were given. |
Reached milestones are never stored. They are worked out from the stats when a player joins, and milestones reached before are not told again. A category or milestone whose file is gone keeps its claims stored and hidden. They come back with the file.
Claims
- A left or right click claims a milestone. Number keys, drop and middle click do nothing.
- Claim All claims every claimable milestone of the open category. A shift-left-click on it claims them in every category.
- The claim is saved first. The rewards run only once the database confirms it.
- A claim that could not be saved gives nothing and stays claimable.
- A player who leaves between the save and the rewards gets them at the next join. The same goes for a server that stops.
A crash at the exact moment between the rewards and their "paid" mark can give that one reward twice. This is a known limit.
Milestones push no booster of their own. A [booster] line in the rewards gives a timed booster, which adds up with the others as described in Boosters.
Configuration
| Key | Default | What it does |
|---|---|---|
enabled | true | The module switch. Off: /milestones disappears. Every claim stays stored. |
display-name | '&bMilestones' | The module's name in /dungeons admin modules. |
notify.complete-sound | ENTITY_PLAYER_LEVELUP | The sound of a milestone reached ('SOUND [volume] [pitch]', '' = none). Also needs the player's core.sounds. |
notify.title.title | '&b&lMILESTONE' | The title of a milestone reached. |
notify.title.subtitle | '&f{category} {roman}' | Its subtitle. Title and subtitle '' = no title. |
notify.title.fade-in | 5 | Fade-in ticks (0 to 200). |
notify.title.stay | 40 | Stay ticks (0 to 600). |
notify.title.fade-out | 10 | Fade-out ticks (0 to 200). |
notify.reminder-minutes | 10 | A chat reminder every this many minutes while the player has unclaimed milestones (0 to 1440). 0 = never. |
claim.sound | ENTITY_EXPERIENCE_ORB_PICKUP | The sound of a claim ('' = none). |
claim.deny-sound | ENTITY_VILLAGER_NO | The sound of a refused claim, like a locked or already claimed one ('' = none). |
claim.deny-cooldown-ticks | 20 | The least ticks between two answers to refused claims, so click spam does not flood the chat (0 to 1200). |
menu.reward-line | '&8 * &f{reward}' | One line of {rewards} in the menu per rewards-display line. |
menu.no-rewards | '&8 * &7None' | The {rewards} of a milestone without rewards ('' = no line). |
commands.main.command | milestones | The command name. '' = no command. |
commands.main.aliases | [ms, milestone] | Other names. An alias that names another SnDungeons command is ignored, with a warning. |
commands.main.permission | '' | Needed for the command and the menu buttons ('' = everyone). |
commands.main.menu | menu | The menu /milestones opens (a file of modules/milestones/guis/). '' = a chat line with the counts. |
The title takes {category} (the category name), {key} and {roman} (the milestone key, like IV) and {level} (its number).
Category files
Each file of modules/milestones/categories/ is one category; its id is the file name (kills.yml = kills). Ids use lowercase letters, digits and -, at most 64 characters. Copy a file to add a category, delete it to remove one, then run /dungeons reload.
The examples (swings, rebirth, kills, money, milestones) are created only while the folder does not exist. A deleted file never comes back, and SnDungeons never updates these files.
| Key | Example | What it does |
|---|---|---|
order | 3 | The tab's position, lower first (equal ones by id). |
name | '&cKills' | The category name. |
icon | IRON_SWORD | The tab's item (a material name). |
source | kills | What it counts (see Sources). |
count | [] | Source milestones only: the categories it counts. [] = every category not of source milestones. |
counts | reached | Source milestones only: reached (claimed or not) or claimed (a reset of the claims takes them back). |
description | two lines | The description of every milestone in the menu ({description}). |
complete-line | 'for killing {required} mobs.' | The third line of the completion message. |
milestones.<key>.required | 100 | The source value needed (above 0). 10000 or '10K' in the number format of config.yml. |
milestones.<key>.rewards | ['[give-currency] souls 500'] | Action lines run once when claimed. |
milestones.<key>.rewards-display | ['&b500 Souls'] | What the menu shows of the rewards (text only). |
Each milestone key is the id stored when it is claimed, like kills.IV. Keep a key once players claimed it. You can insert or reorder milestones freely: the claims follow the keys. The menu names each one "Milestone <key>".
Rewards
Reward lines are action tags: [give-currency], [give-pouch], [booster], [console], [message], [title] and the others of Menus and Action Tags. A line without a tag runs as [console]. {player} is the player's name, and PlaceholderAPI works.
milestones:
IV:
required: 25000
rewards:
- '[give-currency] souls 40000'
- '[booster] swings 1 1h'
rewards-display:
- '&b40,000 Souls'
- '&d1x Swings Booster &8(+1, 1h)'Load warnings
Every problem of a file is one console warning at load:
- An unknown source, currency or track keeps the category out.
- A bad
requiredskips that milestone. - A reward with an unknown tag is reported and does nothing.
- A reward with a click guard (
[left-click]) is dropped.
Menu
modules/milestones/guis/menu.yml (id milestones:menu, 5 rows, title "Milestones"):
| Letter | Tile |
|---|---|
T | The category tabs, in order, left to right: template tab, or tab-open (it glows). |
m | The milestones of the open category, one page per 21 cells: claimable, claimed or locked, plus empty. |
< > | Previous and next page (previous-none and next-none on the first and last page). |
C | Claim All. |
# B | Fillers. |
The shipped look is a diamond for claimable, lime for claimed and red for locked. The stack amount is the milestone's level, up to 64. The menu opens on the category the player viewed last.
The tab templates take {category}, {category_id}, {reached}, {total} and {claimable}. The milestone templates take {category}, {key}, {level}, {description}, {rewards}, {progress} and {required}. Claim All takes {claimable}, {claimable_all} and {category}.
Keep one T cell per category. A category past the last T has no tab (with one warning). The shipped layout has five, one per shipped category.
The actions are [milestones] open, [milestones] tab <category>, [milestones] page next|previous, [milestones] claim <category> <key>, [milestones] claim-all and [milestones] claim-all every. They need the permission of /milestones. [milestones] open and [open] milestones:menu also work from another menu or a reward.
Player settings
| Setting | Default | What it switches |
|---|---|---|
milestones.title | on | The title of a milestone completed. It also needs core.titles. |
milestones.reminder | on | The chat reminder of unclaimed rewards. |
See Player Settings.
Commands
| Command | Permission | Description |
|---|---|---|
/milestones (aliases /ms, /milestone) | commands.main.permission ('') | Opens the milestones menu. |
/dungeons admin milestones reset <player> [category] | sndungeons.admin.milestones.reset | Removes the milestone claims of a player (online or not); the stats stay. |
/dungeons admin milestones claim <player> <category> <key> | sndungeons.admin.milestones.claim | Claims a reached milestone for an online player (its rewards run). |
/dungeons admin milestones info <player> | sndungeons.admin.milestones.info | Shows the milestones of an online player in every category. |
Full lists: Commands and Permissions.
Placeholders
The milestones expose your counts per category and in total. Full list: Placeholders.
| Placeholder | Description |
|---|---|
%sndungeons_milestones_claimable% | Milestones you reached and did not claim |
%sndungeons_milestones_completed%, _total | Milestones you reached in every category, and how many exist |
%sndungeons_milestones_<category>_completed%, _total, _claimable | The same for one category |
%sndungeons_milestones_<category>_progress% | The value of the category's source |
%sndungeons_milestones_<category>_next_required% | The requirement of your next milestone (empty once all are reached) |
The stats behind the sources and the "Top Milestones" board are in Stats and Tops.
Tips
- Put
%sndungeons_milestones_claimable%on a scoreboard so players notice unclaimed rewards. - A
milestonescategory withcounts: claimedpushes players to claim, not just reach. - Test a category with
/dungeons admin milestones info <you>, thenreset <you> <category>to start over. The stats stay, so reached milestones are claimable again.
Default modules/milestones/config.yml
enabled: true
# ============================================================
# SnDungeons - milestones module
# Managed by SnLib: new keys are auto-merged on boot; your values and
# comments are preserved. Re-read on /dungeons reload.
# ============================================================
# Switch of the module (the key above): false turns the milestones off on
# /dungeons reload; /milestones disappears and every claim stays stored. The
# progress is the core stats (swings, kills, the peak of a leveling, what a
# currency earned by playing), so it keeps counting while the module is off.
# The categories (the tabs of /milestones) are the files of categories/ in
# this folder: one file per category, created once with examples; add,
# edit or delete them freely (a deleted file stays deleted).
# Name of the module in /dungeons admin modules (color codes allowed).
display-name: '&bMilestones'
# What a player is told when they reach a milestone: three chat lines
# (reached of the messages file), a sound and a title.
notify:
# The sound of a milestone reached ('SOUND [volume] [pitch]', '' = none).
# Also needs core.sounds of /settings.
complete-sound: ENTITY_PLAYER_LEVELUP
# The title of a milestone reached: {category} is the category name,
# {key} and {roman} the key of the milestone (I, II...), {level} its number.
# A player hides it with milestones.title of /settings (Visuals And
# Sounds); it also needs core.titles. title and subtitle '' = no title.
title:
title: '&b&lMILESTONE'
subtitle: '&f{category} {roman}'
# Ticks (20 = one second): fade-in and fade-out 0 to 200, stay 0 to 600.
fade-in: 5
stay: 40
fade-out: 10
# A reminder in the chat every that many minutes while the player has
# milestones reached and not claimed (reminder of the messages file);
# 0 = never (0 to 1440). A player turns it off with milestones.reminder of
# /settings (Chat).
reminder-minutes: 10
# The claims of the /milestones menu.
claim:
# The sound of a claim ('SOUND [volume] [pitch]', '' = none; core.sounds).
sound: ENTITY_EXPERIENCE_ORB_PICKUP
# The sound of a refused claim (locked, already claimed...; '' = none).
deny-sound: ENTITY_VILLAGER_NO
# The least ticks between two answers to a player's refused claims, so a
# click spam does not flood the chat; a claim that goes through starts it
# too (0 to 1200).
deny-cooldown-ticks: 20
# The {rewards} of a milestone in the menu: one reward-line per line of its
# rewards-display ({reward} = that line), or no-rewards when it has none
# ('' = no line).
menu:
reward-line: '&8 * &f{reward}'
no-rewards: '&8 * &7None'
# The /milestones command. command: '' = no command at all. permission: ''
# = everyone (it also gates the buttons of the menu). menu: the file of
# guis/ in this folder that a player opens with /milestones ('' = a chat line
# with their counts instead). An alias that is the name of another
# SnDungeons command is ignored with a warning.
commands:
main:
command: milestones
aliases:
- ms
- milestone
permission: ''
menu: menuExample category: modules/milestones/categories/kills.yml
# ============================================================
# SnDungeons - milestone category (kills)
# One file per category (a tab of /milestones); the category id is the
# file name (kills.yml = kills): lowercase letters, digits and '-', at most
# 64 characters. Copy this file under a new name to add a category, delete
# it to remove one; /dungeons reload applies either. The claims players
# made stay stored (a category whose file is gone is hidden, and comes back
# with its claims if the file comes back).
# SnDungeons never updates this file, so a key you delete reads its default.
# The example files are created only when the categories folder does not
# exist; a single deleted file never comes back.
# ============================================================
# The position of the tab (lower first; equal ones by id).
order: 3
# The name of the category (color codes allowed).
name: '&cKills'
# The item of its tab (a material name).
icon: IRON_SWORD
# What it counts (a stat of SnDungeons, counted for every player whether
# this module is on or not):
# swings the swings of the zone mob fight
# kills the zone mobs killed
# leveling:<track> the highest level reached in a leveling track (a
# rebirth or a reset never lowers it)
# earned:<currency> what the currency earned by playing (the zone mob
# kills and the enchants, with boosters; never a give,
# a payment, a pouch or an admin change)
# milestones the milestones completed in the categories of count:
# (none = every category that is not of source
# milestones; one never counts itself or another of
# source milestones): reached ones, or claimed ones
# with counts: claimed (see milestones.yml)
source: kills
# The description lines of every milestone in the menu ({description}).
description:
- '&7Kill zone mobs to complete this'
- '&7milestone and earn rewards.'
# The third line of the completion message; {required} is the requirement.
complete-line: 'for killing {required} mobs.'
# The milestones, in order: each KEY is the id stored when it is claimed
# (keep a key once players claimed it; insert or reorder freely, the claims
# follow the keys). Its name in the menu is "Milestone <key>".
# required: the value of the source needed (more than 0; 10000 or
# '10K' in the number format of config.yml). A milestone is
# reached only after the one before it.
# rewards: action lines run once when it is claimed (a line without
# a [tag] runs as [console]); {player} is the player name
# and PlaceholderAPI works. [give-currency], [give-pouch],
# [booster], [console], [message], [title]... (a line with a
# click guard such as [left-click] never runs: it is dropped
# with a warning)
# rewards-display: what the menu shows of the rewards (text only)
milestones:
I:
required: 100
rewards:
- '[give-currency] souls 500'
rewards-display:
- '&b500 Souls'
II:
required: 1000
rewards:
- '[give-currency] souls 2500'
- '[give-pouch] money:t1 1'
rewards-display:
- '&b2,500 Souls'
- '&e1x Money Pouch (Tier 1)'
III:
required: 5000
rewards:
- '[give-currency] souls 10000'
rewards-display:
- '&b10,000 Souls'
IV:
required: 25000
rewards:
- '[give-currency] souls 40000'
- '[booster] swings 1 1h'
rewards-display:
- '&b40,000 Souls'
- '&d1x Swings Booster &8(+1, 1h)'
V:
required: 100000
rewards:
- '[give-currency] souls 150000'
- '[give-pouch] money:t2 2'
rewards-display:
- '&b150,000 Souls'
- '&e2x Money Pouch (Tier 2)'