Skip to main content

đŸ—„ī¸ Database Configuration

Choose a storage type in plugins/CraftEngine/config.yml and use its example below. SQLite is the default. Restart the server after changing these settings.

Storage saves feature data, such as resource pack preferences. Only the database dependencies needed by the selected type are downloaded.

JSON​

storage:
type: json
# Data directory; relative paths start at plugins/CraftEngine/
directory: ./data/json

SQLite​

storage:
type: sqlite
# Required JDBC URL; relative paths start at the server working directory
# Create the parent directory first if using another location
url: 'jdbc:sqlite:./plugins/CraftEngine/data.db'
# SQLite needs no credentials and uses one connection

H2​

storage:
type: h2
# Required JDBC URL; relative paths start at the server working directory
# Create the parent directory first if using another location
# Do not add the .mv.db suffix
url: 'jdbc:h2:./plugins/CraftEngine/data'
username: sa # Database username
password: '' # Database password
pool_size: 4 # Maximum connections; minimum 1

MySQL​

storage:
type: mysql
# Required JDBC URL with the server address, port and database name
url: 'jdbc:mysql://localhost:3306/minecraft'
username: craftengine # Database username
password: 'your_password' # Database password
pool_size: 4 # Maximum connections; minimum 1

MariaDB​

storage:
type: mariadb
# Required JDBC URL with the server address, port and database name
url: 'jdbc:mariadb://localhost:3306/minecraft'
username: craftengine # Database username
password: 'your_password' # Database password
pool_size: 4 # Maximum connections; minimum 1

PostgreSQL​

storage:
type: postgresql
# Required JDBC URL with the server address, port and database name
url: 'jdbc:postgresql://localhost:5432/minecraft'
username: craftengine # Database username
password: 'your_password' # Database password
pool_size: 4 # Maximum connections; minimum 1

MongoDB​

storage:
type: mongodb
# Required URL; supports mongodb:// and mongodb+srv:// and must include a database name
url: 'mongodb://localhost:27017/minecraft?authSource=admin&maxPoolSize=10'
username: '' # Authentication username; leave empty if authentication is disabled
password: '' # Authentication password
# Credentials in the URL take precedence; without authSource, authenticate against its database