Repository navigation
How It Works
A walkthrough of how DexRewards counts a player's progress, when rewards unlock, and when progress updates.
Every file in config/DexRewards/dex_types/ is a dex type: a list of Pokémon to complete, plus reward tiers for reaching certain percentages. The file name is the dex type's ID, so kanto_shiny.json is used as /dex rewards kanto_shiny.
Each dex type tracks its progress separately. A player can be working on the National Dex, a shiny dex and an all-forms dex at the same time. See Your_Dex_Type.json for every setting.
A dex type starts from one of Cobblemon's Pokédexes (pokedex, e.g. cobblemon:national or cobblemon:kanto) and then filters it. A species is part of the dex type only if it passes every check:
-
Implemented: if
implemented_onlyistruein Config.json, the species must be implemented in Cobblemon. -
Valid species: if
valid_speciesisn't empty, the species must be in it. -
Ignored species: the species must not be in
ignored_species. -
Valid labels: if
valid_labelsisn't empty, the species must have at least one of those labels. -
Ignored labels: the species must not have any label in
ignored_labels.
The number of species left is the dex type's total, shown by %pokedex_total%.
Tip
If a dex type ends up with no species at all, DexRewards logs a warning on start and on /dex reload. It's usually a typo in valid_species or valid_labels.
require_caught and require_shiny decide what the player needs for a species to count:
require_caught |
require_shiny |
A species counts when the player has... |
|---|---|---|
true |
false |
Caught or otherwise obtained it. |
false |
false |
Seen it (caught Pokémon count as seen too). |
true |
true |
Obtained a shiny one. See Shiny Tracking. |
false |
true |
Seen a shiny one. |
With require_all_forms set to true, the dex type counts every form instead of every species. Each form is a separate entry, so Vulpix adds two (Normal and Alola) and Rotom adds six. Catching an Alolan Vulpix moves progress forward even before you have a normal one.
Cobblemon lists some forms that can't be caught, such as Mega Evolutions and Gigantamax. Add those to ignored_forms so the dex can be completed.
The counting mode applies to each form the same way: with require_caught and require_shiny, each form needs its own shiny.
Cobblemon's Pokédex records that a player has seen a shiny, but not whether they caught one. So for dex types with both require_caught and require_shiny, DexRewards keeps its own record of every shiny the player has obtained:
- A shiny is recorded whenever one enters the player's party or PC: caught, traded, given by a command, or given as a DexRewards reward.
- Changing an owned shiny's form records the new form too, for example a shiny Rotom changed into Wash Rotom.
- When a player joins, every shiny in their party and PC is recorded, so shinies obtained while the mod wasn't tracking them still count.
Shinies stay recorded even after they're released or traded away. The record is saved in Player_Data.json.
Each dex type has reward groups, each with a required_percent. A player's progress percentage is:
progress = counted Pokémon / total Pokémon × 100
When a player's progress reaches a group's required_percent, the group becomes claimable, and the player is sent the reward_claimable and rewards_to_claim messages from Messages.json. Players claim rewards by clicking the group in /dex rewards. Each group can be claimed once.
Groups in the GUI show one of three states, styled in Reward_GUI.json:
| State | Meaning |
|---|---|
| Locked | The player's progress is below the group's required_percent. |
| Claimable | Unlocked and not claimed yet. Click to claim. |
| Claimed | Already claimed. |
Note
Claimed rewards stay claimed until /dex reset is used. Claimable rewards are recalculated, so raising a group's required_percent above a player's progress locks it again until they catch up.
Progress is recalculated automatically:
- When a player joins.
- Whenever a player's Pokédex changes: seeing, scanning or catching a Pokémon.
- When a player obtains a shiny, or an owned Pokémon changes form.
- For every online player after
/dex reload. - For one player with
/dex update <player>.
Player data is only saved to disk when something actually changed, and saves happen in the background so they never slow down the server.
- Your_Dex_Type.json: every dex type setting and reward type.
- Commands: opening the GUI, resetting and updating progress.
- Placeholders: showing progress in messages, the GUI and other mods.