Storage & Data
What the plugin saves, where it lives, how to switch to MySQL, autosave, and what resets between sessions.
The plugin keeps two kinds of player data, plus your arena layout and floating leaderboards, and it is worth knowing which is which.
Kept forever
Saved in a database, either a SQLite file or a MySQL server (see Choosing a database). By default it is plugins/StealABrainRot/data.db, a SQLite file, with nothing to set up.
- Lifetime stats: games played, money earned, steals, intercepts, deaths, crates opened, mobs bought and sold, and how many of each tier
- Rebirths and unlocked achievements
- Crates waiting to be opened
- Glass colors and cosmetics owned, and what is equipped
- Daily and weekly records for the leaderboards
Stats load when a player logs in and save when they leave the game, when they log out, on shutdown, and every storage.autosave-seconds (60 by default) while they are online. So a crash loses at most a minute of progress, and the daily and weekly boards stay close to live. Saving happens in the background and never lags the server. A player's data is never saved over until it has been read first, so a slow database can not wipe anyone's stats.
Players can see their own with /brainrot stats.
Reset every session
- The money balance for the current game (in internal economy mode)
- The mobs in their base (they disappear and the base frees up)
- Traps they placed
- Base upgrades they bought
Restore on rejoin
bases:
restore-on-rejoin: false # set to trueWith this on, a player who leaves has their base remembered: every mob sitting in a slot, their money, and their upgrade levels. The next time they claim a base (any base), it all comes back and they are told how many mobs were restored. Mobs that were being stolen or were still walking home are not kept. A round ending never saves anything, since the whole arena resets. It is off by default because it lets players carry progress from one session to the next.
Choosing a database
The storage section at the top of config.yml picks where data goes. Changing it needs a full restart, not just a reload.
storage:
type: sqlite # or mysql
mysql:
host: localhost
port: 3306
database: brainrot
username: root
password: ""
use-ssl: false
table-prefix: "sab_"
extra-options: ""
autosave-seconds: 60SQLite (the default) keeps everything in data.db next to the config. Nothing to install, nothing to set up. The right choice for a single server.
MySQL or MariaDB is for when several servers should share one set of stats and leaderboards, or you already run a database for other plugins. Create an empty database, put its details under storage.mysql, set type: mysql, and restart. The console should say Storage: MySQL (...). The plugin creates its own two tables (sab_player_stats and sab_period_stats with the default prefix) on first start. The MySQL driver already ships with Spigot and Paper, so there is no extra jar to add.
If the MySQL connection fails at startup, the plugin logs why and falls back to SQLite for that session, so stats are never silently lost. Connections the database server closes after sitting idle are reopened on their own.
Updating from an older version needs nothing from you. New columns are added to your existing table on first start, and every stat you already had is kept.
Switching from SQLite to MySQL does not move existing data across. Stats start fresh on the new database unless you copy the tables over yourself.
Arena layout and leaderboards
Base positions, claim zones, shield corners, plates, slots, trap zones and runway paths for every arena live in arenas.yml as plain text. It is written the moment you run a setup command and never rewritten on shutdown, so hand edits stick. Back this file up once your arenas are built, it is the one that takes real work to recreate.
Floating leaderboards are kept in leaderboards.yml, written by /brainrot admin leaderboard create and remove.