Kingsmend Idle Wiki

Mods

Mods let players add new content or change how the game works. There are two kinds: data mods (a JSON file) and script mods (JavaScript).

The short version

  • Add or remove mods in Settings, on the Mods screen.
  • Data mods add content: skills, items, activities and places. The game checks each file when it loads.
  • Script mods can change almost anything. They are not sandboxed, so only install mods you trust.
  • The Mods screen has the file format and a working example to start from.

Data mods

A JSON file that adds content: skills, items, activities and places. The game checks the file when it loads and refuses anything that would break a save or point to something that does not exist. Items from a data mod work just like the game's own.

Script mods

A JavaScript module that runs with the same power as the game itself. It gets one object, api (API v1). With it a mod can add content of every kind, change rules, add bonuses, use every game command, listen for changes, add panels, pages, styles, messages and settings, keep its own data in the save, and depend on other mods.

You confirm your trust on the Mods screen. The game does not sandbox script mods, so only install mods you trust.

For mod makers: keep away time fair

Time away must give the same result as time spent watching, with mods too. Two rules keep it that way:

  • Register content, rules and bonuses when the game starts. They stay fixed for the session.
  • Change your mod's saved data only through a game command.

A bonus that reads the clock or rolls its own dice breaks this, and away time will stop matching watched time.

Reference

The Mods screen in Settings has the full file format and an example mod. A script mod can list everything it can use with Object.keys(api).