-
Notifications
You must be signed in to change notification settings - Fork 0
Configuration
This walks through config.yml section by section. messages.yml and templates.yml are covered at the bottom.
database:
type: json # json | sqlite | mysql | postgresql | h2
mysql:
host: localhost
port: 3306
database: sxbans
username: root
password: ''json is the default and needs nothing else configured — every punishment record becomes a file under plugins/SXBans/data/. It's fine for most servers. If you want a real relational database (recommended once you're running a larger network, or if you want to query the data with other tools), see Database Setup for the tradeoffs and setup steps for each option.
redis:
enabled: false
host: localhost
port: 6379
password: ''
database: 0Only relevant if you're syncing punishments across multiple servers. See Network Setup.
network:
server-name: 'game-server'
sync-punishments: true
bungee-messaging:
enabled: false-
server-name— what this server calls itself. Shows up in logs, the web panel's "server" column, and (if Redis sync is on) in the messages sent to other servers. Set it to something meaningful:survival,skyblock,lobby-1. -
sync-punishments— whether punishments actually propagate to other servers over Redis. Has no effect unlessredis.enabledis alsotrue. -
bungee-messaging.enabled— an older, BungeeCord-specific sync mechanism kept for compatibility. If you're setting this up fresh, use Redis instead — it works with Velocity too and doesn't require a player to be online to relay a message.
web:
enabled: true
port: 8080
session:
timeout: 86400session.timeout is in seconds — how long a web panel login stays valid before it needs to be renewed. Default is 24 hours.
warnings:
max: 5
auto-ban:
enabled: true
ban-duration: 86400000 # milliseconds; -1 for a permanent banOnce a player accumulates warnings.max active warnings, auto-ban (if enabled) bans them automatically. ban-duration is in milliseconds, not seconds — set it to -1 for a permanent ban instead of a temporary one.
Whether a punishment gets announced in chat, and to whom, is actually controlled per-punishment-type inside messages.yml (see below) rather than here — that's where you'll find broadcast_to_everyone and permission for each punishment type.
Every player-facing and staff-facing string in the plugin lives here — command usage text, error messages, success messages, the broadcast announcements, and the hover tooltips that show up when you mouse over a broadcast in chat.
A single entry looks like this:
broadcast:
ban:
message: '&c%player% &7was banned by &c%executor%'
broadcast_to_everyone: false
permission: 'sxbans.admin.punishview.ban'
hover:
- '&6&l=== SXBans Punishment ==='
- '&7Player: &f%player%'
- '&7Executor: &f%executor%'
- '&7Reason: &f%reason%'
- '&7Duration: &f%duration%'
- '&7Date: &f%date%'
- '&7Server: &f%server%'
- '&6&l========================'-
message— what shows in chat. -
broadcast_to_everyone— iffalse, only players withpermissionsee the announcement. Iftrue, everyone sees it regardless of permission. -
hover— the tooltip shown when a player mouses over the broadcast message. Purely cosmetic, fully optional, but a nice touch for staff.
Standard color codes (&a–&f, &0–&9, &l, &o, etc.) and hex colors work throughout. So does Unicode — emoji, accented characters, whatever your server's theme calls for. Just make sure the file is saved as UTF-8 (any modern text editor does this by default).
Available placeholders vary by message but generally include %player%, %executor%, %reason%, %duration%, %date%, %server%, %ip%, and %count%/%max% for warnings — check the existing entries for the message you're editing to see what's available there.
Reusable punishment reasons, so staff don't have to retype "Use of X-ray / unfair advantage" every single time. Edit these to match the offenses you actually deal with on your server.
/sxbans reload picks up changes to all three files without a server restart. If you've edited messages.yml and don't see your changes, double check you're editing the file inside plugins/SXBans/, not a copy somewhere else — and make sure the YAML is valid (an editor with YAML syntax highlighting will save you a lot of grief here).