Skip to content

database.yml

database.yml carries a config-version: '1' and is brought forward automatically on update, the same as config.yml and messages.yml.

A spawner’s own state — its type, levels, stack, owner, itemised store contents, experience, and its own boosters — lives in the block’s own data and travels with the chunk. The database only holds what has to be answerable while that chunk is asleep: how many spawners a player owns, who may touch which one, what is waiting for somebody who was not online, and the action log. See How spawners work.

storage:
type: SQLITE
server: 'main'
# SQLITE only.
file: 'data.db'
# MYSQL and MARIADB only.
host: 'localhost'
port: 3306
database: 'atlasspawner'
username: 'root'
password: ''
properties: {}
pool:
maximum: 8
timeout: 5000
write-back: 60
  • SQLITE keeps a file (storage.file, default data.db) next to database.yml and needs no setup at all. Use it for a single server.
  • MYSQL and MARIADB are the same driver and the same settings — they exist as two names for convenience, not as two backends. Use one of them to share what belongs to a player between several servers.

storage.properties is appended to the JDBC connection URL; because the driver is MariaDB’s (which also speaks to MySQL), use MariaDB’s own property spelling, for example sslMode: disable or connectTimeout: 5000.

storage.server is this server’s own name in the tables. Every server sharing one database must have a name of its own — worlds are not shared between servers, so a spawner belongs to exactly one server and is written down against its name. Two servers sharing a database with the same storage.server value will collide.

write-back (seconds, default 60) is how often what a spawner is currently holding is written into the shared index, purely so lists and leaderboards have a number to show while a chunk is asleep. It is read for nothing but display, so it can be as slow as you like — writing it every time a spawner produces would be thousands of statements a minute to keep a number nobody is watching exact.

Because MYSQL and MARIADB share one driver, pointing several servers at the same database (with distinct storage.server values) is the supported way to let a player’s spawners, whitelist, boosters and returns follow them between servers. Leaderboards (/atlasspawner top) are still per server; only the ownership list (owned) is read across every server sharing the database.