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.
Structure
{
"achievements": [
{
"id": "test_achievment",
"name": "First Night",
"tooltip": "You survived the first night!",
"conditions": {
"deathsMax": 999
}
}
]
}
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
| Parameter | Description |
|---|---|
deathsEq / deathsMin / deathsMax | Number of deaths |
mobsKilledEq / mobsKilledMin / mobsKilledMax | Mobs killed |
blocksDestroyedEq / blocksDestroyedMin / blocksDestroyedMax | Blocks destroyed |
distanceWalkedEq / distanceWalkedMin / distanceWalkedMax | Distance walked |
jumpsEq / jumpsMin / jumpsMax | Number of jumps |
damageDealtEq / damageDealtMin / damageDealtMax | Damage 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.
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
- Single condition
- Multiple conditions
{
"achievements": [
{
"id": "test_achievment",
"name": "First Night",
"tooltip": "You survived the first night!",
"conditions": {
"deathsMax": 999
}
}
]
}
{
"achievements": [
{
"id": "test_achievment",
"name": "First Night",
"tooltip": "You survived the first night!",
"conditions": {
"deathsMax": 999,
"mobsKilledMin": 10,
"jumpsEq": 1
}
}
]
}