Configuration
On this page(4)
SnPlayerCount ships with the following YAML files. New keys are auto-merged on boot; your edits and comments are preserved.
config.yml
# ============================================================
# SnPlayerCount - configuration
# Managed by SnLib: new keys are auto-merged on boot; your values and
# comments are preserved. Do NOT add a config-version key (retired).
# Set update-configs: false to freeze this file (SnLib only warns about
# missing keys instead of inserting them).
# Sections marked "# sn:extensible" are yours: entries you delete there
# stay deleted.
# ============================================================
# Active language code; loads lang/messages_<code>.yml (falls back to en).
lang: en
# Master switch of the SnLib auto-updater for this plugin's managed files.
update-configs: true
# Runtime debug output (applied on /snplayercount reload).
debug:
# Master toggle of the debug output.
enabled: false
# Verbosity threshold: OFF, INFO, DEBUG or TRACE.
level: DEBUG
# Category filter; an empty list lets every category through.
categories: []
# ------------------------------------------------------------
# Main command.
# ------------------------------------------------------------
command:
# Aliases of /snplayercount. Re-read on /snplayercount reload.
aliases: [spc]
# ------------------------------------------------------------
# Proxy servers.
# ------------------------------------------------------------
# Proxy server names to query, exactly as registered in velocity.toml [servers] /
# BungeeCord config.yml. Each is asked directly with PlayerCount <name>. Leave empty
# to auto-discover with GetServers (some hardened proxies never answer it).
# Placeholders: %snplayercount_<name>% (case-insensitive) and %snplayercount_total%
# (the whole network).
servers:
- Auth
- Lobby
- Gens
- OkiPVP
- WorldBox
- Work
- Work2
# ------------------------------------------------------------
# Refresh.
# ------------------------------------------------------------
# Seconds between two requests to the proxy (minimum 1).
update-interval: 3
# ------------------------------------------------------------
# Vanished staff (SnStaff).
# ------------------------------------------------------------
# The proxy counts vanished players like anyone else, so other servers would show
# one more player than this server's tab. With SnStaff installed, every server
# reports how many of its players are vanished and every server leaves them out
# of the placeholders. Servers without SnStaff still apply the reports they get.
# Keep update-interval the same on every server: reports arrive at the sender's pace.
vanish:
# Leave vanished staff out of the counts.
enabled: true
# This server's name in the proxy config (velocity.toml [servers]), e.g. Gens.
# Empty: this server does not report its own vanished staff.
server-name: ""
# Seconds a report keeps counting after it arrived (never less than two refreshes).
ttl-seconds: 10The servers list
Each name is asked directly with PlayerCount <name>. The names must match your proxy config (velocity.toml [servers] or BungeeCord config.yml). Matching is case-insensitive, and blank or repeated entries are ignored.
Leave the list empty to auto-discover servers with GetServers. Some hardened proxies never answer that request, and every per-server placeholder then reads 0, so prefer listing your servers.
The vanish section
The proxy counts vanished players like anyone else, so without this a server would read one more player from outside than its own tab shows.
With SnStaff installed, each server counts its vanished staff and sends the number to every other server through the BungeeCord Forward subchannel. Every server, with or without SnStaff, leaves those players out of both placeholders.
- On every backend that runs SnStaff, set
vanish.server-nameto that server's name in the proxy config, then run/spc reload. - Keep
update-intervalthe same on every server: reports arrive at the sender's pace. - A report stops counting
ttl-secondsafter it arrived, so a server that stops simply stops subtracting.
While server-name is empty, that server does not report its vanished staff. If SnStaff is installed there, the plugin says so once at startup.
lang/messages_en.yml
# ============================================================
# SnPlayerCount - language file (English)
# Managed by SnLib: new keys merge in on boot, your values are kept.
# Restyle any line freely; your edits survive updates.
# ============================================================
# Prefix prepended to every single-line message sent via sn.lang().send(...)
prefix: "₢f2&lSnPlayerCount &8| &7"
# snlib.* is SnLib's shared command contract (14 keys; the two help.group-*
# keys exist since SnLib 1.36.0). Every Sn plugin ships
# this block UNCHANGED: SnLib bundles NEUTRAL defaults for any key you omit and
# merges them in on boot, so an incomplete block leaks unbranded lines. Shipping
# the FULL block is what keeps the whole fleet visually identical. Placeholders
# {plugin} {usage} {description} {page} {total} {min} {max} {value} {command}
# {group} {path} are filled by SnLib. NEVER put {prefix} here (it is auto-prepended).
snlib:
no-permission: "&cYou do not have permission to use this command."
usage: "&cUsage: &e{usage}"
invalid-number: "&cInvalid number: &e{value}"
invalid-value: "&cInvalid value: &e{value}"
out-of-range: "&cValue must be between &e{min} &cand &e{max}&c: &e{value}"
number-too-small: "&cValue must be at least &e{min}&c: &e{value}"
player-not-found: "&cPlayer not found: &e{value}"
unknown-subcommand: "&cUnknown subcommand: &e{value}"
reload-done: "&aConfiguration reloaded."
help:
header: "&8&m----------&r ₢f2&l{plugin} &8&m----------"
# Branded no-separator form. SnLib's neutral default is "&e{usage} &7{description}".
entry: "₢f2{usage} &7{description}"
footer: "&7Page &f{page}&7/&f{total} &8- ₢f2/{command} help <page>"
# Own help of a groupHelp() command group (/<cmd> admin <module> help).
group-header: "&8&m----------&r ₢f2&l{group} &8&m----------"
group-footer: "&7Page &f{page}&7/&f{total} &8- ₢f2{path} help <page>"