# Kronen

**Kronen is KyuubiSoft's own server currency for servers without another economy. Players get a balance, send money to each other (also to people who are offline) and pay for bank pages, player shops, claims and the other KS features in Kronen. Admins switch it on in one window, see where money comes from and where it goes, help players with give, take and set, and read a protocol of every booking.**

<ModGallery mod="kronen" />

:::caution[Not released yet]
Kronen comes with **Core 2.10.0** and **Bank 2.7.0**. Both are not released yet and have not been tested in game. Windows, texts and numbers can still change before the release.
:::

---

## How it works

- **Off by default.** Nothing changes on your server until an admin switches Kronen on. While it is off, every KS mod works as before, and neither Core nor the Bank creates the data folder `mods/kyuubisoft_kronen/`.
- **The name.** In English the game shows **Crown** / **Crowns** ("250 Crowns"), in German **Krone** / **Kronen**. Every language has its own name, and you can change them in the admin window. There is no symbol by default; you can pick `¤`, `£`, `¥` or `¢` instead of the name.
- **Only when there is no other economy.** Once every plugin has started, Kronen checks whether a different economy is active. If not, Kronen runs the economy. If there is one, Kronen steps back: the KS mods pay through the other economy and all balances stay saved.
- **Every KS mod pays with it at once.** Claims, Guilds, Quests, Events, Order Board, Shops, Bank, Season Pass, Graveyard, the NPC shops and the dialog coins already pay through Core, so with Kronen on they book in Kronen without any change.
- **Other plugins see it too.** When the shared economy interface is installed and no other economy is enabled there, Kronen registers with it, so plugins of other authors can use the same balances.
- **Two carriers, one currency.** Core carries Kronen. On a server with KyuubiSoft Bank but without Core, the Bank carries it. Both use the same data folder `mods/kyuubisoft_kronen/`, so nothing is lost when Core is added or removed later. See [Who carries Kronen](#who-carries-kronen).
- **Safe bookings.** Every booking is written to a journal before a balance changes. After a crash the next start finishes or undoes open bookings. Balances never go below zero, and every booking records which mod paid and why.

---

## Switching it on

1. Open the admin window: `/kskronenadmin`, the **Crowns** tile in the `/ksadmin` hub (with Core), or the **Crowns** button in the header of `/ksbank admin` (when the Bank carries Kronen).
2. Go to **Settings** and click the switch **Switch Crowns on**.
3. The window asks first: "Really switch on? Applies to everyone at once." Above the question, the box **What changes when switched on** lists what will cost money or pay out from then on.
4. Confirm with **Switch on**. The state changes to **Ready** and, on a running server, at once to **Active** (or to **Stepped back** when another economy is active).

Switching off also asks first: "Really switch off? Prices and payments go back to the old behaviour; balances are kept."

Instead of the window you can create `mods/kyuubisoft_kronen/config.json` with just `{"enabled": true}` while the server is stopped; every other setting then keeps its default. The file is read when the server starts.

### What changes when you switch it on

The box reads the settings of every installed KS mod (the same values as the [Money sources](#money-sources) area) and lists what is on. With the factory settings of the KS mods these lines appear:

| Mod | Line |
|-----|------|
| Bank | Bank pages cost 250 to 2,500 – free without an economy today |
| Shops | Founding a player shop costs 500 |
| Shops | The shop directory entry costs 100 per day |
| Shops | Rental stations cost 100 per day |
| Graveyard | Premium designs and particles cost 300 to 750 |
| All | Nobody gets money by itself: start balance 0, no source on |

Only installed mods appear. Claims, Guilds, the shop rent and taxes, the gravestone teleport, quest rerolls and the Order Board fee cost nothing until an admin sets a price in that mod. When a mod pays out (rewards, buy-backs), the last line reads "N sources pay out · start balance N" instead.

Without any economy, bank pages, claims and guilds are free and trading in player shops is locked. With Kronen on, these things work with money.

### States

The **Overview** shows the state at the top, and the navigation shows it at the bottom left.

| State | Meaning |
|-------|---------|
| **Off** | Switched off (the default). The KS mods run as before. |
| **Off · the settings file cannot be read** | `mods/kyuubisoft_kronen/config.json` has an error. Kronen stays off until you fix the file by hand; nothing is overwritten. |
| **Off · the balances cannot be read** | The balances in `mods/kyuubisoft_kronen/` cannot be loaded. Nothing is overwritten; the server log says why. |
| **Off · blocked by the economy setting of Core** | `economyProvider` in Core's `config.json` is set to a value that allows no economy. Set it to `auto` (or `kronen`) and restart. |
| **Ready** | On; decided once the server has started. |
| **Active** | Kronen runs the economy. All KS mods pay with it. |
| **Stepped back** | Another economy was active at the start. The KS mods pay through it; the accounts rest and nothing is lost. You can [move the balances](#moving-to-a-different-economy). |
| **Resting** | Two carriers are installed and the other one keeps the accounts. Open the window there. |

The decision at the start stays until the next restart. An economy plugin that is added while the server runs changes nothing until then.

### Core's `economyProvider`

`economyProvider` in `mods/kyuubisoft_core/config.json` decides whether Core may use Kronen:

| Value | Kronen |
|-------|--------|
| `auto` (default) | Used when no other economy is active |
| `kronen` | Always used, also when another economy is installed |
| anything else (`internal`, `command`, the name of an economy) | Off ("blocked by the economy setting of Core") |

`internal` still means "no economy". `"force": true` in Kronen's own config file does the same as `kronen`, also when the Bank carries the currency, but it never overrides a Core setting that blocks every economy.

---

## Who carries Kronen

| Installed | Carrier |
|-----------|---------|
| Core 2.10.0 or newer (with or without Bank) | **Core**. The Bank 2.7.0 shows Core's balances in its account tab and books page prices in Kronen through Core. |
| Bank 2.7.0 without Core | **Bank**. Balances, `/kskronen`, `/kskronenadmin` and the admin window work with the Bank alone. |
| Bank 2.7.0 with an older Core | **Bank**. The older Core does not know Kronen; other KS mods only pay in Kronen when the shared economy interface is installed, because the Bank registers Kronen there. Their bookings then all show the source "KyuubiSoft", because the older Core cannot tell the mods apart. |

- Both carriers use the same folder `mods/kyuubisoft_kronen/`. When Core is added later, Core takes over the same balances; when it is removed, the Bank continues with them.
- A lock file (`carrier.lock`) makes sure that only one carrier books. A second carrier "rests" and writes a log line. A lock left behind by a crash is taken over at the next start, with a log line; the lock carries a heartbeat, so this also works when the system has given the old process number to another program.
- When Core's `economyProvider` blocks Kronen, Core still holds the lock, so the Bank does not take over silently.

---

## Commands

| Command | What it does | Permission |
|---------|--------------|------------|
| `/kskronen` | Shows your balance and a hint line. With `ks.kronen.admin` also a status line. From the console: the status line | `ks.kronen.user.balance` |
| `/kskronen pay <person> <amount> [reason]` | Sends money, also to people who are offline | `ks.kronen.user.pay` |
| `/kskronen history` | Your last 10 bookings as chat lines (players only) | `ks.kronen.user.balance` |
| `/kskronenadmin` | Opens the admin window (players only) | `ks.kronen.admin` |

The commands have no aliases. The carrier registers them: Core always (also while Kronen is off, then `/kskronen` answers "Crowns are switched off on this server."), the Bank only when it carries the currency.

### `/kskronen`

```
Crowns · Your balance: 2,480 Crowns
Crowns · Send with /kskronen pay <person> <amount> [reason] · your last bookings: /kskronen history
```

Admins see a third line such as `State: active (no-other-economy) · 214 accounts · 1,284,300 Crowns in total`.

### `/kskronen pay <person> <amount> [reason]`

```
/kskronen pay Mira 250
/kskronen pay Juno 300 for the oak logs
```

- **Person:** the name must match exactly (upper and lower case do not matter). Online players come first; people who are offline can be paid when their name is known on the server. A close name is only suggested: "Nobody called "Mria" found – did you mean **Mira**?". When several offline accounts have exactly that name (after a rename), nothing is sent and the command answers "Several people were called "Mira" – the right one has to be online." The bank uses the same rule.
- **Amount:** written with the separators of your language (`1,250` in English, `1.250` in German), up to two decimals.
- **Reason:** optional, everything after the amount, up to 120 characters. The recipient sees it.
- One transfer per second and person ("One transfer per second – please wait a moment."), the same for `/kskronen pay`, the bank and other mods. You cannot pay yourself and never more than you have.
- The server can switch transfers off and set limits per transfer and per day ([Settings](#settings)).

Answers: "You sent Mira **250 Crowns** · you have 2,230 Crowns left." For an offline recipient the line adds "Mira is offline and gets a note at the next login."

**The recipient** gets a card at the top of the screen ("Kyuubi sent you **250 Crowns**" with the reason and the new balance), or a chat line when no card can be shown. People who were offline get a summary at their next login: "Since your last visit your balance changed by **+250 Crowns** · bookings: 1 · /kskronen history".

### `/kskronen history`

Prints your last 10 bookings from the last 30 days, newest first:

```
Your last bookings (4):
+225 Crowns · Order Board · Collected from the pickup box · 11/10 16:20
-200 Crowns · Claims · 2 chunks bought · 11/10 14:05
+250 Crowns · Transfer from Mira · "thanks for the iron" · 11/10 11:30
+500 Crowns · From the server team · "prize of the build event" · 11/09 18:02
```

Bookings of the server team show "From the server team" and the reason, never the admin's name.

---

## Permissions

| Permission | Default | Gates |
|------------|---------|-------|
| `ks.kronen.user.balance` | allowed | `/kskronen`, `/kskronen history` |
| `ks.kronen.user.pay` | allowed | `/kskronen pay` and **Send** in the account tab of the bank |
| `ks.kronen.admin` | not granted | `/kskronenadmin`, the **Crowns** tile in the `/ksadmin` hub, the **Crowns** button in the bank admin, every action in the admin window (checked again on each click), the status line of `/kskronen` and the chat line about bookings that other admins make |

The two player nodes are "allowed unless set": set them to `false` to take the feature away from a group. The `/ksadmin` hub itself needs Core's `ks.admin`, the bank admin `ks.bank.admin`.

```bash
/lp group admin permission set ks.kronen.admin true
/lp group guest permission set ks.kronen.user.pay false
```

---

## The admin window

`/kskronenadmin`, the **Crowns** tile in the `/ksadmin` hub ("Server currency") or the **Crowns** button in `/ksbank admin` open the same window. Its title is the currency's name ("Crowns"); the subtitle says where it belongs ("Server currency · in the /ksadmin hub" with Core, "Server currency · in the bank admin" with the Bank). The navigation has five areas: **Overview**, **Money sources**, **Accounts**, **Settings** and **Protocol**. Below them stand the state and the note "Needs ks.kronen.admin. Players need ks.kronen.user.balance and ks.kronen.user.pay – allowed by default."

### Overview

- **State** with an explanation and a button: **Switch on …** while off, **Move balances …** while stepped back, otherwise **Settings ›**.
- **Tiles:** the money in the game (all accounts), money in and out during the last 7 days, the number of accounts.
- **In and out · 7 days:** a bar per day. "In" is money from the mods, the start balance and the server team's give; "out" is money paid to the mods and the server team's take. Transfers between players count neither way.
- **Biggest sources** and **Biggest sinks:** the four largest per mod, plus "Server team", "Start balance" and "Moved to another economy".
- **Richest accounts:** the top 5 with their share of all money.
- **Suspicious** (at most 3): a transfer at or above the report threshold within the last 7 days, and "many small amounts to one person" (at least 10 transfers below the threshold from at least 3 people within 24 hours). **Account ›** opens the account. These are hints only; nothing is blocked or booked back.

Shop tills and money letters of the Shops mod are not counted in the money of the game.

### Money sources

A table of everything in the KS mods that creates money, refunds it or takes it out of the game. The values are read from each installed mod's settings when the window opens; the window never changes them.

- **In · money appears**, **Refunds · at most the price paid** and **Out · money leaves**, each with "N of N on".
- Each row: mod and what happens, the amount, a state chip (**on**, **off**, **missing**) and a small line with the factory default when an admin changed the value. A value that cannot be read shows "unknown".
- **Open ›** jumps to that mod's admin window in the `/ksadmin` hub (only with Core).
- **Start balance:** what new players get at their first join, with its own **Save** (0 = none, the default). It is paid once per person, also when the balances are later restored from the backup or rebuilt from the journal, and two logins at the same moment never pay it twice.
- **Warning:** when an admin shop or an NPC shop buys an item back for more than another shop sells it, a line shows "bought for … sold for … – endless money" (up to 2 lines). Only prices in the main currency from the shop files count; offers changed in game in the Shops database are not checked.

### Accounts

- **Search a person – also offline**, filters **All**, **Online** and **Suspicious**, and the list sorted by balance (up to 60 rows, "60 of 214 · by balance").
- The details of an account: since when it exists and when the person was last seen, the balance, money in and out during 7 days, transfers sent and received, the last booking, and the 6 newest bookings. **In the protocol** opens the protocol filtered to this person.
- **Give**, **Take** and **Set** open a small dialog:
  - **Amount** (or **New balance** for Set) and **Reason · required** (up to 80 characters). The button only works with a valid amount and a reason.
  - "New balance … instead of …" updates while you type.
  - Take never goes below 0 ("Only what is there is taken."). Setting the balance it already has is refused.
  - The person gets a note with the reason, shown as "From the server team" without your name. Your name and the reason go into the protocol and the server log, and every other admin online gets a chat line such as "Admin · Kyuubi gave Mira **500 Crowns** · reason: prize of the build event".

### Settings

Each section has its own **Save** button (it reads **Saved** while nothing has changed).

- **Switch Crowns on:** the switch with the confirmation described in [Switching it on](#switching-it-on). While it is on, the box below is called **What applies now**.
- **Name per language:** singular and plural for English and German in the window, **All 9 languages** opens the list for the others. Polish and Russian have three forms (1 · 2 to 4 · from 5), Turkish always uses the singular after numbers. A name has 1 to 20 characters, without curly brackets and stars.
- **Display:** the symbol (**none**, `¤`, `£`, `¥`, `¢`; no euro sign, the game font lacks it), a preview, and **Always show decimals** ("on: 1,250.00 always with two decimals", "off: 1,250 · 7.50 only when an amount has decimals").
- **Transfers:** **Allow transfers**, **At most per transfer** and **At most per day and person** (whole numbers, 0 = no limit) and **Report as suspicious from** (10,000 by default; only a hint in the overview).
- **Change the economy:** **Move balances …**, see below.

### Protocol

Every booking of the last 30 days, newest first (up to 150 rows, "showing 150 of N").

- Filters: type (**All**, **In**, **Out**, **Transfer**, **Admin**; moves count as Admin), **Source** (a list of every source of the 30 days) and **Person**.
- Columns: **Time**, **Type**, **Source · booking**, **Person**, **Amount**, **Balance** (the balance after the booking).
- A transfer is two lines with the same number, booked in one step, with the reason as typed ("No. 4812 · "for the oak logs""). A transfer at or above the report threshold is marked.
- Admin lines read "Admin · Given", "Admin · Taken" or "Admin · Set to N" with "by Kyuubi · reason: …".

### Reasons in the protocol

KS mods give each booking a short reason that Kronen shows in the language of whoever reads it later, in the protocol, in `/kskronen history` and in the bank. A booking without a reason shows only the mod's name.

| Source | Reasons (English) |
|--------|-------------------|
| Claims | "2 chunks bought", "Claim failed, money back", "2 chunks of extra quota bought", "Refund for 2 released chunks", "Claim dissolved, refund for 2 chunks" |
| Guilds | "Guild founded · Name", "Founding failed, fee back · Name" |
| Events | "1st place · Event" (2nd, 3rd), "Taking part · Event", "Attendance · Event", "Raffle win · Event" |
| Order Board | "Order posted, reward and fee held in escrow", "Collected from the pickup box" |
| Bank | "Page 3 unlocked", "Coins deposited", "Paid out as coins" |
| Shops | "Bought at Shop", "Sold to Shop", "Booking undone · Shop", "Player shop founded · Shop", "Shop closed, half the founding fee back · Shop", "Directory listing for 3 days · Shop", "Shop rent · Shop", "Rental station for 2 days · Stand", "Rental extended by 2 days · Stand", "Rental auction won · Stand", "Paid into the shop till · Shop", "Taken from the shop till · Shop", "Shop earnings collected", "Money letter from the mailbox" |
| Graveyard | "Premium design · Name", "Premium particles · Name", "Teleport to a gravestone" |
| Quests | "Daily quest rerolled", "Weekly quest rerolled" |
| Season Pass | "Premium pass · Season", "Token payout", "Token payout, booked later", "Season shop purchase" |

Reasons that people type (transfers, the server team) always stay exactly as typed. Bookings made before these reasons existed keep the text they were saved with.

---

## Moving to a different economy

If the server installs a different economy later, Kronen steps back at the next start: the KS mods pay through the new economy, and the Kronen balances stay saved. The balances can then be moved once:

1. Open **Settings** › **Move balances …** (or **Move balances …** in the state box of the Overview).
2. The dialog shows where the money comes from ("Crowns in Core"), the target economy ("none found yet" while there is none), the number of accounts and their total, an **exchange rate** (two numbers above 0: so many Crowns equal so much in the new economy) and what the new economy gets at that rate. Afterwards every account is at 0, with one protocol line per account.
3. **Move N accounts** starts it. The result reads "Moved N accounts (…); N refused and booked back."

- The preview always works; moving only works while Kronen has stepped back for another economy.
- The money is **added** at the target, never overwritten. If the move stops halfway, a new try continues where it stopped; no account gets paid twice. A payment the target refuses is booked back to the Kronen account.
- When the other economy gives no clear answer for an account (it failed during the payment and may have booked it), that account is **not** booked back, because that could double the money. It stays marked, the window reports "N unclear: the other economy gave no clear answer – they stay marked, check them there (server log)" and the server log names it. Check its balance in the other economy; it is never moved twice.
- After the move the button reads **Already moved**, and players see "Moved to the new economy" in their history.

---

## Who pays and charges in Kronen

These are the rows of the **Money sources** area. Values are read from the mod's data folder `mods/kyuubisoft_<mod>/`; a missing file or key counts as the factory default. Only installed mods appear.

**In · money appears**

| Mod | What | Setting | Factory default |
|-----|------|---------|-----------------|
| Shops | Buy-back in the admin shop | `admin-shops/*.json`: items with `sellEnabled` and a `sellPrice` | none |
| Core | NPC shop buy-back | `shops/*.json`: `sellEnabled` in the main currency | none |
| Core | Dialog "give coins" | `dialogs/*.json`: actions `give_coins` | none |
| Events | Reward in Crowns | `events.json`: rewards of type currency | none |
| Quests | Reward in Crowns | `configs/*.json`: rewards of type currency | none |
| Season Pass | Pay tokens out as Crowns | the active season's `currencyMode` = `economy` | `internal` (off) |
| Order Board | Server orders | `orders.json`: open server orders with a coin reward | none |
| Showcase | Start balance for visitors | `config.json`: `visitorStartBalance` | 1,000 |

**Refunds · at most the price paid**

| Mod | What | Setting | Factory default |
|-----|------|---------|-----------------|
| Claims | Release a chunk | `economy.enabled`, `economy.chunkUnclaimRefund` | off / 50 |
| Shops | Delete a shop | half of `playerShops.creationCost` | 250 |

**Out · money leaves**

| Mod | What | Setting | Factory default |
|-----|------|---------|-----------------|
| Bank | Buy a bank page | `upgrade.enabled`, `upgrade.defaultCosts` | on, 250 to 2,500 |
| Shops | Found a player shop | `playerShops.creationCost` | 500 |
| Shops | Directory entry | `playerShops.listingEnabled`, `playerShops.listingPricePerDay` | on, 100 per day |
| Shops | Rental station and auction | `rentalStations.enabled`, `rentalStations.defaultPricePerDay` | on, 100 per day |
| Shops | Shop rent | `rent.enabled`, `rent.costPerDay` | off / 50 per day |
| Shops | Purchase and sales tax | `tax.enabled`, `tax.buyTaxPercent`, `tax.sellTaxPercent` | off / 5 % |
| Claims | Claim a chunk | `economy.enabled`, `economy.chunkCost` | off / 100 |
| Claims | Buy extra chunks | `economy.enabled`, `economy.purchaseChunkCost` | off / 500 |
| Guilds | Found a guild | `general.foundingFee` | 0 |
| Graveyard | Premium designs and particles | `config/graveyard.json`: `purchaseWithEconomy`, prices of `designs` and `particles` | on, 300 to 750 |
| Graveyard | Teleport to the gravestone | `config/graveyard.json`: `allowTeleportToGravestone`, `teleportCost` | off / 0 |
| Quests | Reroll a quest | `economy.provider` not `internal`, `economy.rerollCostGold` | off / 200 |
| Season Pass | Premium pass | the active season's `premiumCost` and `premiumCurrencyId` | 1,000, currency not set ("missing") |
| Order Board | Fee when posting | `fee.percent` | 0 % |

Trading between players (player shop sales, the shop till, money letters, transfers) only moves money from one account to another.

See the pages of [Bank](https://wiki.kyuubisoft.com/hytale/bank/), [Player Shops](https://wiki.kyuubisoft.com/hytale/player-shops/), [Claims](https://wiki.kyuubisoft.com/hytale/claims/), [Guilds](https://wiki.kyuubisoft.com/hytale/guilds/), [Graveyard](https://wiki.kyuubisoft.com/hytale/graveyard/), [Quests](https://wiki.kyuubisoft.com/hytale/quest-system/) and [Season Pass](https://wiki.kyuubisoft.com/hytale/season-pass/) for these settings.

---

## Configuration

Kronen has its own config file, `mods/kyuubisoft_kronen/config.json`, shared by both carriers. While Kronen is off, nothing is written and the folder does not exist; the file appears when you switch Kronen on or save a setting in the admin window. By hand, a file with `{"enabled": true}` is enough; missing keys keep their defaults. A folder that only holds the untouched default config of an earlier test build is removed again at the start. Edit the file by hand only while the server is stopped; the admin window writes the same file and applies its changes at once.

```json
{
  "configVersion": 1,
  "enabled": false,
  "names": {
    "en-US": { "one": "Crown", "other": "Crowns" },
    "de-DE": { "one": "Krone", "other": "Kronen" },
    "fr-FR": { "one": "couronne", "other": "couronnes" },
    "es-ES": { "one": "corona", "other": "coronas" },
    "it-IT": { "one": "corona", "other": "corone" },
    "pt-BR": { "one": "coroa", "other": "coroas" },
    "pl-PL": { "one": "korona", "few": "korony", "many": "koron" },
    "ru-RU": { "one": "крона", "few": "кроны", "many": "крон" },
    "tr-TR": { "one": "kron" }
  },
  "symbol": "",
  "decimals": 2,
  "alwaysShowDecimals": false,
  "transfersEnabled": true,
  "maxPerTransfer": 0,
  "maxPerDayPerPerson": 0,
  "reportThreshold": 10000,
  "startBalance": 0,
  "force": false
}
```

| Key | Default | Meaning |
|-----|---------|---------|
| `enabled` | `false` | Kronen on or off. In the window: the switch in **Settings** |
| `names` | see above | The name per language with the forms `one`, `few`, `many`, `other`. Languages that are missing keep their default names |
| `symbol` | `""` | `""` writes the name ("250 Crowns"); `¤`, `£`, `¥` or `¢` write the symbol instead ("250 ¤") |
| `decimals` | `2` | `2`: amounts down to hundredths. `0`: every booking is rounded to whole amounts, and a withdrawal below half a unit is refused (only in the file) |
| `alwaysShowDecimals` | `false` | `true` always shows two decimals; `false` only when an amount has some |
| `transfersEnabled` | `true` | Players may send money to each other |
| `maxPerTransfer` | `0` | Highest amount per transfer, whole amounts, `0` = no limit |
| `maxPerDayPerPerson` | `0` | Highest sum a person may send within 24 hours, `0` = no limit |
| `reportThreshold` | `10000` | Transfers from this amount are marked as suspicious in the overview and the protocol (a hint only) |
| `startBalance` | `0` | What a new player gets at their first join while Kronen books, once per person, `0` = nothing. In the window: **Money sources** › **Start balance** |
| `force` | `false` | `true` keeps Kronen even when another economy is installed (like Core's `economyProvider: "kronen"`) |

Amounts in the file are whole amounts, not hundredths. An unreadable file is never overwritten: Kronen stays off and the log names the error.

### Data files

| Path | Content |
|------|---------|
| `mods/kyuubisoft_kronen/config.json` | The settings |
| `mods/kyuubisoft_kronen/carrier.lock` | Which mod carries Kronen right now (only while on) |
| `mods/kyuubisoft_kronen/balances.json` | All balances; saved within 5 seconds of a change and at shutdown |
| `mods/kyuubisoft_kronen/balances.json.bak` | A copy, at most every 10 minutes |
| `mods/kyuubisoft_kronen/balances.json.broken-<time>` | An unreadable `balances.json`, set aside instead of replacing the backup (only when that happened) |
| `mods/kyuubisoft_kronen/journal/<year>-<month>.jsonl` | Every booking, one file per month |

If `balances.json` is missing or unreadable, the balances are rebuilt from the backup and the journal, names included. A booking counts once it is safely on the disk: if the disk does not confirm it, it is refused and stays refused after a restart. Back up the whole folder together.

---

## For mod authors

`CoreAPI.currency()` returns Kronen (or `null` before Core's setup): `isActive()`, `balance(uuid)`, `has(uuid, amount)`, `deposit(uuid, amount, source, reason)`, `withdraw(uuid, amount, source, reason)`, `transfer(from, to, amount, source, reason)`, `format(amount, language)` and `name(amount, language)`. Amounts are rounded to hundredths. Without `source`, Kronen records the calling mod. A reason can be a code with arguments such as `"claims.chunks_bought|2"`; its text `kronen.reason.<code>` is shown in each reader's language. KS mods that already pay through Core's economy bridge need no change.