Zum Hauptinhalt springen

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].

Felder

FeldTypStandardBeschreibung
staffPermissionStringsecurity.adminPermission that marks a player as staff and requires authentication.
adminPermissionStringsecurity.staffauth.adminPermission required for password reset and force logout operations.
commandNameStringstaffauthCommand used for status, logout and administrative StaffAuth operations.
maxAttemptsInt5Maximum failed attempts before the player is kicked. 0 = disabled.
maxAttemptsKickMessageVar<String><red>Too many failed attempts. ({attempts})Kick message when max attempts exceeded. Use {attempts} placeholder.
registerMessageVar<String><red>Please register using the StaffAuth interface.Message sent when an unregistered staff joins.
loginMessageVar<String><red>Please authenticate using the StaffAuth interface.Message sent when a registered staff joins.
guiTitleVar<String><dark_red><bold>Staff AuthenticationTitle of the GUI authentication menu.
blockMessageVar<String><red>You must authenticate first!Message sent when interacting while unauthenticated.
successMessageVar<String><green>Authentication successful!Message sent on successful authentication.
guiLoginPromptVar<String><gray>Click to authenticateSubtitle shown on the GUI login screen before password entry.
wrongPasswordMessageVar<String><red>Wrong password! (<attempts>/<max>)Message sent on wrong password. Use {attempts} and {max} placeholders.
minPasswordLengthInt6Minimum password length.
maxPasswordLengthInt128Maximum password length. Prevents oversized BCrypt work and memory usage.
bcryptCostInt12BCrypt cost factor used for new registrations.
attemptCooldownSecondsInt1Base cooldown in seconds after a failed authentication attempt.
passwordTooShortMessageVar<String><red>Password must be between {length} and {max} characters!Message when password length is invalid. Use {length} and {max} placeholders.
passwordMismatchMessageVar<String><red>Passwords do not match!Message sent on password mismatch during registration.
successSoundSoundEMPTYSound played on successful authentication.
errorSoundSoundEMPTYSound played on authentication error.
useGuiWhenAvailableBooleantrueWhether to use the GUI menu when the GUI extension is available.
preventFallDamageBooleantrueWhether to prevent fall damage for unauthenticated players.
sessionTimeoutMinutesInt0Session 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).

  • staffPermission is the permission that makes a player subject to authentication; adminPermission guards the reset and force-logout subcommands.
  • The cooldown after a wrong password is attemptCooldownSeconds doubled at each consecutive failure, capped at 60 seconds. maxAttempts kicks the player after that many failures; 0 disables the kick.
  • bcryptCost applies to new registrations only (values are clamped between 4 and 31). Each +1 doubles the hashing time.
  • sessionTimeoutMinutes sends 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 default wrongPasswordMessage uses <attempts> and <max>, which are not replaced by the code of this version; replace them with {attempts} and {max}.
  • preventFallDamage off lets unauthenticated players take fall damage; every other damage stays blocked.