Staff Auth Config
Staff Auth Config
Configuration entry for StaffAuth. Defines permission, messages, sounds, and security settings. Event handling is done by [btc.renaud.staffauth.events.AuthListeners].
フィールド
| フィールド | 型 | デフォルト | 説明 |
|---|---|---|---|
staffPermission | String | security.admin | Permission that marks a player as staff and requires authentication. |
adminPermission | String | security.staffauth.admin | Permission required for password reset and force logout operations. |
commandName | String | staffauth | Command used for status, logout and administrative StaffAuth operations. |
maxAttempts | Int | 5 | Maximum failed attempts before the player is kicked. 0 = disabled. |
maxAttemptsKickMessage | Var<String> | <red>Too many failed attempts. ({attempts}) | Kick message when max attempts exceeded. Use {attempts} placeholder. |
registerMessage | Var<String> | <red>Please register using the StaffAuth interface. | Message sent when an unregistered staff joins. |
loginMessage | Var<String> | <red>Please authenticate using the StaffAuth interface. | Message sent when a registered staff joins. |
guiTitle | Var<String> | <dark_red><bold>Staff Authentication | Title of the GUI authentication menu. |
blockMessage | Var<String> | <red>You must authenticate first! | Message sent when interacting while unauthenticated. |
successMessage | Var<String> | <green>Authentication successful! | Message sent on successful authentication. |
guiLoginPrompt | Var<String> | <gray>Click to authenticate | Subtitle shown on the GUI login screen before password entry. |
wrongPasswordMessage | Var<String> | <red>Wrong password! (<attempts>/<max>) | Message sent on wrong password. Use {attempts} and {max} placeholders. |
minPasswordLength | Int | 6 | Minimum password length. |
maxPasswordLength | Int | 128 | Maximum password length. Prevents oversized BCrypt work and memory usage. |
bcryptCost | Int | 12 | BCrypt cost factor used for new registrations. |
attemptCooldownSeconds | Int | 1 | Base cooldown in seconds after a failed authentication attempt. |
passwordTooShortMessage | Var<String> | <red>Password must be between {length} and {max} characters! | Message when password length is invalid. Use {length} and {max} placeholders. |
passwordMismatchMessage | Var<String> | <red>Passwords do not match! | Message sent on password mismatch during registration. |
successSound | Sound | EMPTY | Sound played on successful authentication. |
errorSound | Sound | EMPTY | Sound played on authentication error. |
useGuiWhenAvailable | Boolean | true | Whether to use the GUI menu when the GUI extension is available. |
preventFallDamage | Boolean | true | Whether to prevent fall damage for unauthenticated players. |
sessionTimeoutMinutes | Int | 0 | Session timeout in minutes. 0 = no timeout. |
How to use it
Create exactly one of these. commandName is the base command (default staffauth, with the subcommands described on the extension page).
staffPermissionis the permission that makes a player subject to authentication;adminPermissionguards the reset and force-logout subcommands.- The cooldown after a wrong password is
attemptCooldownSecondsdoubled at each consecutive failure, capped at 60 seconds.maxAttemptskicks the player after that many failures; 0 disables the kick. bcryptCostapplies to new registrations only (values are clamped between 4 and 31). Each +1 doubles the hashing time.sessionTimeoutMinutessends an authenticated player back to the login after that many minutes; 0 means no timeout.- In messages, write
{attempts},{max}and{length}with curly braces. The defaultwrongPasswordMessageuses<attempts>and<max>, which are not replaced by the code of this version; replace them with{attempts}and{max}. preventFallDamageoff lets unauthenticated players take fall damage; every other damage stays blocked.