Enter at least two characters

config.yml

Docs version: v1.4.6

KaLogin main configuration file is:

plugins/KaLogin/config.yml

After editing it, run /kl reload. Restart the server after changing database type, authentication mode, or dependency plugins.

Basic settings#

language: "en_US"
use-AuthMe: true
check-update: true
Option Description
language Message language. Built in values are zh_CN and en_US
use-AuthMe Use AuthMe as the authentication backend
check-update Check for updates when OP players join

Database#

SQLite works by default:

database:
  type: "sqlite"
  sqlite:
    file_name: "data.db"

Use MySQL if multiple servers need shared account data:

database:
  type: "mysql"
  mysql:
    host: "localhost"
    port: 3306
    database: "kalogin"
    username: "root"
    password: "password"
    params: "?useSSL=false&serverTimezone=UTC"
Option Description
database.type Storage type, sqlite or mysql
database.sqlite.file_name SQLite database file name
database.mysql.host MySQL host
database.mysql.port MySQL port
database.mysql.database MySQL database name
database.mysql.username MySQL username
database.mysql.password MySQL password
database.mysql.params JDBC connection parameters

Password policy#

settings:
  min-password-length: 6
  max-password-length: 20
  password-regex: "^[a-zA-Z0-9!@#$%^&*()_+\\-=\\[\\]{};':\"\\\\|,.<>/?~`]+$"
  password-blacklist:
    - "PASSWORD"
    - "password"
    - "123456"
    - "12345678"
  has-uppercase: false
  has-lowercase: false
  has-symbol: false
  has-number: false
  max-consecutive-same-digits: 3
Option Description
min-password-length Minimum password length
max-password-length Maximum password length
password-regex Allowed password characters
password-blacklist Text that cannot appear in passwords
has-uppercase Require uppercase letters
has-lowercase Require lowercase letters
has-symbol Require symbols
has-number Require numbers
max-consecutive-same-digits Maximum repeated same digit count. 0 disables this limit

Login and registration limits#

login:
  register-timeout: 90
  login-timeout: 90
  max-login-attempts: 3
  max-accounts-per-ip: 3
  show-auto-login-checkbox: true
  dialog-delay-ticks: 1
Option Description
register-timeout Registration timeout in seconds
login-timeout Login timeout in seconds
max-login-attempts Maximum wrong password attempts before kick
max-accounts-per-ip Maximum accounts registered from one IP. 0 disables this limit
show-auto-login-checkbox Show the same IP auto login checkbox
dialog-delay-ticks Delay before opening the login or registration screen

For public servers, disabling same IP auto login is recommended:

login:
  show-auto-login-checkbox: false

Change password#

change-password:
  max-attempts: 3
Option Description
max-attempts Maximum old password failures during password change

Welcome terms#

welcome-dialog:
  enabled: true
Option Description
enabled Enable the welcome and terms confirmation screen

Terms text is edited in plugins/KaLogin/ui/welcome.yml. See Welcome and Terms.

Error prompt type#

error-prompt-type: "body"
Value Effect
none Do not show error prompts
body Show errors inside the screen body
toast Show errors as Toast prompts

Input settings#

Input width, height, labels, and defaults are configured under inputs.

Property Description
width Input width
height Input height. Use -1 to disable multiline mode
labelVisible Show the input label
initial Default value or default checkbox state

Common input paths:

Path Use
inputs.login.login_password Login password input
inputs.login.auto_login_by_ip Same IP auto login checkbox
inputs.register.reg_password Registration password input
inputs.register.reg_confirm_password Registration confirm password input
inputs.change-password.old_password Old password input
inputs.change-password.new_password New password input
inputs.change-password.confirm_new_password Confirm new password input
inputs.bind-email.email Email input
inputs.bind-email.code Email code input
inputs.recover-password.code Recovery code input
inputs.recover-password.new_password Recovery new password input
inputs.recover-password.confirm_new_password Recovery confirm password input
inputs.welcome.accept_terms Terms confirmation checkbox

Email binding#

email-binding:
  enabled: true
  code-expire-seconds: 300
  smtp:
    host: "smtp.qq.com"
    port: 587
    auth: true
    starttls: true
    ssl: true
    username: "xxx@qq.com"
    password: "xxx"
    from-email: "xxx@qq.com"
    from-name: "Server"
Option Description
enabled Enable email binding and password recovery
code-expire-seconds Verification code lifetime in seconds
smtp.host SMTP server host
smtp.port SMTP server port
smtp.auth Use SMTP authentication
smtp.starttls Use STARTTLS
smtp.ssl Use SSL
smtp.username SMTP username
smtp.password SMTP password or app password
smtp.from-email Sender email address
smtp.from-name Sender display name

See Email Binding and Password Recovery.

Login and registration actions#

events:
  login:
    - 'console: say Player %player_name% logged in!'
    - 'toast: type=task;icon=paper;title=<green>Login successful;description=<gray>Welcome back, %player_name%'
    - 'wait: 20'
    - 'command: spawn'
  register:
    - 'console: say Player %player_name% registered!'
    - 'toast: type=goal;icon=emerald;title=<aqua>Registration successful;description=<gray>Welcome, %player_name%'
    - 'wait: 20'
    - 'command: help'

See Login and Registration Actions.