Skip to content

Database

DeDet edited this page Jun 8, 2026 · 1 revision

Database

SpContentQuests uses a database to persist player quest progress. It supports two database backends: SQLite (default) and MySQL.

SQLite (Default)

By default, the plugin uses SQLite. The database file is stored at:

plugins/SpContentQuests/database.db

No configuration is needed — it works out of the box. Player data is automatically saved at the configured interval and when players quit the server.

MySQL

To use MySQL, enable it in config.yml:

mysql-settings:
  enabled: true
  hostname: 192.168.1.100
  port: 3306
  database-name: spcontentquests
  user-name: myuser
  user-password: mypassword
  use-ssl: false
  connection-pool-size: 3
Setting Default Description
enabled false Set to true to use MySQL instead of SQLite
hostname 0.0.0.0 MySQL server address
port 0 MySQL server port
database-name '' Name of the database to use
user-name '' MySQL username
user-password '' MySQL password
use-ssl false Enable SSL encryption for the connection
connection-pool-size 3 Maximum connections in the HikariCP pool

Important: If you switch from SQLite to MySQL (or vice versa), existing data will not be automatically transferred. You'll need to migrate it manually.

Auto-Save

Player data is saved automatically at the interval configured in config.yml:

auto-save-interval: 5  # Minutes between automatic database saves

Data is also saved whenever a player quits the server, ensuring minimal data loss in case of a crash.

What Is Stored?

The database stores:

  • Each player's UUID
  • Per-quest completion status (ongoing, completed, claimed)
  • Per-quest objective progress values
  • Per-category completion state

Data Commands

You can manage player data in-game using admin commands:

Command Description
/spcontentquests resetall <player|all> Reset all progress for a player or everyone
/spcontentquests resetcategory <category> <player|all> Reset progress in a specific category
/spcontentquests quest reset <quest> <player> Reset a single quest

Note: resetall all and resetcategory <category> all can only be run from console.

Clone this wiki locally