Skip to main content

Custom achievements

You can define your own custom achievements in the mod's config. Achievements with specified requirements for obtaining, a description, and an achievement name are added to the achievements.json file.

On the summary screen every earned achievement is shown as a token on the player's card. Hovering over the token shows the name and, if it is set, the tooltip. A card shows up to three achievements.


Structure​

{
"achievements": [
{
"id": "test_achievment",
"name": "First Night",
"tooltip": "You survived the first night!",
"conditions": {
"deathsMax": 999
}
}
]
}
info

The id determines whether an achievement has already been earned. Multiple achievements can share the same id, but they will be counted as one - if a player has earned any achievement with that id, all others sharing it will also be marked as earned.


Conditions​

ParameterDescription
deathsEq / deathsMin / deathsMaxNumber of deaths
mobsKilledEq / mobsKilledMin / mobsKilledMaxMobs killed
blocksDestroyedEq / blocksDestroyedMin / blocksDestroyedMaxBlocks destroyed
distanceWalkedEq / distanceWalkedMin / distanceWalkedMaxDistance walked
jumpsEq / jumpsMin / jumpsMaxNumber of jumps
damageDealtEq / damageDealtMin / damageDealtMaxDamage dealt
  • Eq - exactly the value required
  • Min - minimum value required
  • Max - maximum value allowed

All conditions in one achievement must be satisfied at the same time. Statistics are counted since the player's last sleep, not since the world was created - see player statistics.

tip

After editing achievements.json, apply it without restarting:

/midnightthoughts reload achievements

The command reports how many achievements were loaded, which is the quickest way to catch a typo that made one of them invisible.


Example​

{
"achievements": [
{
"id": "test_achievment",
"name": "First Night",
"tooltip": "You survived the first night!",
"conditions": {
"deathsMax": 999
}
}
]
}