Skip to content

Previous: Installation · Next: Commands & Permissions

⚙️ Configuration File config.yml Explained

QinhCoreLib (hereafter QCL) has only one main configuration file: plugins/QinhCoreLib/config.yml. It auto-generates default content on first startup. This page walks through every key section by section and item by item, explaining each key's default value, allowed values, purpose, and whether a /qcl reload is enough after editing or a server restart is required.

📌 General rule: any change involving a database connection method switch or a module toggle is best applied with a server restart to be safe; pure numeric/toggle changes (such as debug, the economy default provider, javascript debug) mostly take effect with /qcl reload. The exact behavior is noted under each item below.


🗂️ Full config.yml Source

Below is the complete content generated by default in QCL 1.2.0, which you can copy directly as a template:

yaml
database:
  type: sqlite           # sqlite or mysql
  sqlite:
    data-folder: data    # data folder relative to the plugin directory
  mysql:
    host: localhost
    port: 3306
    database: qinhcorelib
    username: root
    password: ""
debug:
  enabled: false
  prefix: "[QinhCoreLib-Debug]"
economy:
  default-provider: auto # auto|vault|excellenteconomy|ee|playerpoints|pp. auto: prefer EE when a currency is set, otherwise Vault>EE>PlayerPoints
  default-currency: money # EE currency id (money/silver/gold...), ignored by Vault/PlayerPoints
javascript:
  enabled: true
  default-function: main # the default function called when a script reference omits the function name
  debug:
    print-stacktrace: false
attribute:               # attribute backend (the whole ecosystem reads it from here)
  backend: native        # native (built-in native attributes, no plugin needed) | attributeplus | auto
modules:                 # disable modules you don't need (all true by default)
  config: true
  database: true
  reflection: true
  modelengine: true
  customcrops: true
  craftengine: true
  mythicmobs: true
  neigeitems: true
  mmoitems: true
  gui: true
  action: true
  pdc: true
  item: true
  hologram: true
  scheduler: true
  condition: true
  expression: true
  script: true
  economy: true
  customblock: true
  assembly: true

🗡️ attribute — Attribute Backend

KeyDefaultAllowedPurpose
attribute.backendnativenative / attributeplus / autonative = QCL's built-in native attributes, no attribute plugin required; attributeplus = hand to AttributePlus; auto = prefer third-party if present, else fall back to native

The whole ecosystem (QI/QS/QC/QSt/QF) reads the backend from here. How attributes work and how to make your own → Attribute System.


🛢️ database — Data Storage

QCL provides unified data storage for the entire Qinhuai ecosystem.

KeyDefaultAllowed ValuesPurpose
database.typesqlitesqlite, mysqlChoose the storage backend
database.sqlite.data-folderdataAny directory nameSQLite data folder (relative to the plugin directory)
database.mysql.hostlocalhostHost/IPMySQL address
database.mysql.port3306Port numberMySQL port
database.mysql.databaseqinhcorelibDatabase nameMySQL database name
database.mysql.usernamerootUsernameMySQL account
database.mysql.password"" (empty)Password stringMySQL password

🧭 When to Use Which?

ScenarioRecommended
Single server, few players, want simplicitysqlite (zero config, works out of the box)
Cross-server / large server / need external data accessmysql

📁 SQLite Data Directory Structure

When type: sqlite, data is stored in plugins/QinhCoreLib/data/ (i.e. the directory specified by data-folder):

plugins/QinhCoreLib/data/
├── global.db        # global database (shared, cross-player data)
├── {uuid}.db        # one separate database per player, filename is the player UUID
├── {uuid}.db
└── ...

💡 global.db stores global data, and each player has a separate database file named after their UUID. To back up, simply archive the entire data/ directory.

⚠️ Things to Know After Editing

  • Switching type (sqlite ⇄ mysql) or changing the MySQL connection parameters: a server restart is required. The database connection is established at startup, and /qcl reload will not reconnect.
  • After switching, data is not migrated automatically — the two backends are independent.

🐛 debug — Debug Output

KeyDefaultAllowed ValuesPurpose
debug.enabledfalsetrue/falseWhether to print debug logs
debug.prefix[QinhCoreLib-Debug]Any stringDebug log prefix

When troubleshooting, set enabled to true and the console will output more detailed internal logs, each line carrying the prefix to make filtering easier.

⚠️ Things to Know After Editing

  • /qcl reload is enough (reload refreshes the config).

💰 economy — Economy Integration

QCL wraps multiple economy plugins in a unified way, so sub-plugins don't need to care which economy is used underneath.

KeyDefaultAllowed ValuesPurpose
economy.default-providerautoauto, vault, excellenteconomy/ee, playerpoints/ppDefault economy provider
economy.default-currencymoneyEE currency id (e.g. money/silver/gold)Default currency id

🔄 The auto Logic of default-provider

When set to auto, QCL picks automatically according to these rules:

  • When a currency (currency id) is specified → prefer ExcellentEconomy (EE) (since only EE supports multiple currencies).
  • When no currency is specified → priority order is Vault > EE > PlayerPoints, using whichever is available.

If you want to lock to a single economy plugin, just set default-provider directly to vault / ee / pp.

💵 When Does default-currency Matter?

ProviderUses default-currency?
ExcellentEconomy (EE)✅ Yes, must be a valid EE currency id
Vault❌ Ignored (Vault is single-currency)
PlayerPoints❌ Ignored

In other words, default-currency only matters when using EE, determining which currency is operated on by default.

🔗 When writing economy actions in places like GUIs, you can override the default with a more precise format, e.g. excellenteconomy:gold:50. See Commands & Permissions and the developer docs Economy API.

⚠️ Things to Know After Editing

  • /qcl reload is enough (reload reloads the economy).

📜 javascript — Script Engine

QCL has a built-in JavaScript script engine for sub-plugins to hook in logic (such as QI's crafting validation).

KeyDefaultAllowed ValuesPurpose
javascript.enabledtruetrue/falseWhether to enable the script engine
javascript.default-functionmainAny function nameThe default function called when a reference omits the function name
javascript.debug.print-stacktracefalsetrue/falseWhether to print the full stack trace when a script errors

🧩 Script Path Format

The script reference format is: namespace:relative-path.js[:functionName]

qinhitems:hooks/craft.js:check   # calls the check function of hooks/craft.js under the qinhitems namespace
qinhitems:hooks/craft.js         # no function name → calls default-function (default main)
  • default-function: when a reference omits the function name, this is the default function called (default main).
  • print-stacktrace: set to true during development/troubleshooting; when a script throws an exception, the full Java stack trace is printed for easier diagnosis.

⚠️ Things to Know After Editing

  • /qcl reload reloads scripts, and most changes can be hot-reloaded; if you turn enabled off/on, a restart is recommended to ensure it is fully applied.

🔗 For script development, see Script API.


🧱 modules — Module Toggles

QCL is modular. The modules section lets you disable individual modules you don't need, all true by default.

Capabilities of Each Module

Module NameCapability
configConfig loading (foundational, recommended to keep enabled)
databaseData storage (SQLite/MySQL)
reflectionReflection utilities
modelengineModelEngine integration (model entities)
customcropsCustomCrops integration (crops)
craftengineCraftEngine integration (custom blocks/items)
mythicmobsMythicMobs integration
neigeitemsNeigeItems integration
mmoitemsMMOItems integration
guiCustom GUI system
actionAction system
pdcPersistentDataContainer data storage
itemItem system (including unified item source references)
hologramHologram text
schedulerScheduler
conditionCondition system
expressionExpression evaluation
scriptScript system
economyEconomy integration
customblockCustom blocks
assemblyAssembly/composition

🔧 How to Disable a Module

Just change the corresponding key to false. For example, if you don't need MythicMobs integration:

yaml
modules:
  mythicmobs: false

⚠️ Side-Effect Warning When Disabling

  • Features that depend on a disabled module will stop working. For example, after disabling item, unified item source references, GUI item references, and sub-plugins' item APIs will all be affected.
  • Sub-plugins (QI/QS/QF/QSt, etc.) may depend on certain modules. Unless you are sure they are unused, do not casually disable core modules such as config, database, item, action, script, economy.
  • Only when you are sure the server does not have the corresponding external plugin installed is it safe and resource-saving to turn off the matching integration module (such as modelengine, mythicmobs).
  • After disabling a module, it will show as "not enabled" in /qcl status detail.

⚠️ Things to Know After Editing

  • Module toggles affect the initialization flow, so a server restart is recommended to load/unload modules completely cleanly.

📋 Quick Reference: How Changes Take Effect

Config SectionIs reload enough?Notes
database (connection/type)❌ RestartConnection is established at startup
debug✅ reload
economy✅ reloadreload reloads the economy
javascript✅ reload (mostly)Restart recommended for the enabled toggle
modules❌ RestartAffects module loading

📖 Continue Reading