Storage
PxIgnis provides persistent JSON key-value storage for global and per-player data. Data is saved automatically on server stop, player disconnect, and /ignis reload.
Storage Locations
Section titled “Storage Locations”Right now it uses JSON as the storage backend. In the future it may support real databases (SQLite/Posgtres/MySQL)
without the API changes. And maybe we’ll have an sqlite lib.
| Scope | File |
|---|---|
| Global | config/ignis/storage/global.json |
| Per-player | config/ignis/storage/players/<uuid>.json |
-- Global data (available everywhere)mc.data.key = "value"local v = mc.data.key
-- Per-player data (in command/event handlers)ctx.player.data.coins = 100local coins = ctx.player.data.coinsSupports numbers, strings, booleans, tables, and nil (deletes the key).
Nested Tables
Section titled “Nested Tables”Deep writes work directly — no special workaround needed:
-- This persists on save:data.stats.kills = 5data.stats.name = "player_stats"Data Validation
Section titled “Data Validation”The following types are not allowed in storage and will raise an error:
- Functions
- Userdata
- Threads
- Tables with cyclic references
Persistence
Section titled “Persistence”Data is written to disk on:
- Server stop
- Player disconnect (per-player data only)
/ignis reload
Per-player data is removed from the in-memory storage map on disconnect (but remains on disk).
Atomic Writes
Section titled “Atomic Writes”All file writes use an atomic write pattern: data is written to a temporary file first, then atomically moved to the target path. This prevents data corruption if the server crashes mid-write.