-
Notifications
You must be signed in to change notification settings - Fork 0
HyLeveling Configuration
AzureDoom edited this page Dec 27, 2025
·
2 revisions
The database section controls how HyLeveling stores player data such as UUID and experience.
| Database | Example JDBC URL |
|---|---|
| H2 (file) | jdbc:h2:file:./hyleveling/hyleveling;MODE=PostgreSQL |
| MySQL | jdbc:mysql://host:3306/dbname |
| MariaDB | jdbc:mariadb://host:3307/dbname |
| PostgreSQL | jdbc:postgresql://host:5432/dbname |
Notes
- H2 typically uses an empty username and password unless explicitly configured.
- MySQL, MariaDB, and PostgreSQL require valid credentials.
database:
jdbcUrl: "jdbc:h2:file:./hyleveling/hyleveling;MODE=PostgreSQL"
username: ""
password: ""
maxPoolSize: 10- Type: String
- Description: JDBC connection string used to connect to the database.
- Default: H2 file database in the plugin data directory.
- Type: String
- Description: Database username.
- Required: Yes for MySQL, MariaDB, and PostgreSQL.
- Type: String
- Description: Database password.
- Required: Yes for MySQL, MariaDB, and PostgreSQL.
- Type: Integer
- Description: Maximum number of database connections in the connection pool.
-
Default:
10
- Switching between database types (H2, MySQL, MariaDB, PostgreSQL) does not support automatic data migration.
- HyLeveling will treat the new database as empty unless data is manually transferred.
- Always back up your existing database before modifying JDBC settings.
The formula section defines how much XP is required to reach each level.
| Type | Description |
|---|---|
| EXPONENTIAL | XP increases exponentially as levels increase |
| LINEAR | Fixed XP increase per level |
| TABLE | XP values are loaded from a CSV file |
| CUSTOM | XP is calculated using a math expression |
formula:
type: "EXPONENTIAL"
migrateXP: true-
Allowed Values:
EXPONENTIAL,LINEAR,TABLE,CUSTOM
- Type: Boolean
-
Default:
true - Description: Recalculates stored XP when the formula changes to preserve player levels.
exponential:
baseXp: 100.0
exponent: 1.7Formula
XP(level) = baseXp * (level - 1) ^ exponent
linear:
xpPerLevel: 100Formula
XP(level) = xpPerLevel * (level - 1)
The TABLE formula allows you to explicitly define XP floors per level using a CSV file.
table:
file: "levels.csv"- One row per level
- Two columns:
level,xp - Levels must start at
1 - XP represents the XP floor required to reach that level
level,xp
1,0
2,100
3,250
4,450
5,700
6,1000
- Missing levels are not allowed
- Levels must be sequential
- XP values must be increasing
- This method gives full manual control over progression
The CUSTOM formula allows defining XP requirements using a mathematical expression.
custom:
xpForLevel: "exp(a * (level - 1)) * b"
constants:
a: 0.15
b: 100
maxLevel: 100000- The expression must return the XP floor for a level
- Expressions are evaluated using floating-point math
| Variable | Description |
|---|---|
level |
Current level (integer ≥ 1) |
Constants are user-defined numeric values you can reference inside the expression.
constants:
a: 0.15
b: 100For the example above:
- Level 1 →
exp(0) * 100 = 100 - Level 10 →
exp(0.15 * 9) * 100 ≈ 386 - Level 50 →
exp(0.15 * 49) * 100 ≈ 22255
- Type: Integer
- Description: Maximum supported level for this formula.
- Purpose: Used internally for binary search and XP calculations.
- Recommendation: Set this higher than the maximum level your server will ever reach.
- Changing formula types with
migrateXPenabled will preserve player levels. - Disabling migration will keep raw XP values unchanged.
- Always back up your data before switching formulas.