Bans 是一款专为 Paper 服务器设计的惩罚系统。Ban(封禁)、Mute(禁言)、Warning(警告)和 Kick(踢出)均存储在同一数据库中,因此可以随时查询玩家的完整记录,而不仅限于玩家在线时。
该插件不使用原版的 banned-players.json。每条惩罚记录都包含原因、执行者、发出时间及过期时间,因此即使解除封禁,所有历史也不会丢失。
临时惩罚与永久惩罚共用一个命令。 传入持续时间即获得临时惩罚,不传则获得永久惩罚。支持常用格式:30m、2h、7d、1d12h、perm。
Mutes(禁言)确实有效。 聊天功能被屏蔽,包括 /msg、/r 和 /me 等命令也会被禁用。命令列表可配置,因此禁言玩家无法通过私聊绕过惩罚。
可以惩罚离线玩家。 任何曾经加入过服务器的玩家,即使当前不在线,也可以被封禁、禁言或警告。
自动升级惩罚机制。 当玩家达到设定的活跃警告数量后,插件会自动对其施加 Mute 或 Ban。阈值和操作可在配置文件中设置,且整个功能可以关闭。
静默惩罚。 在命令中添加 -s 参数可隐藏对普通玩家的公告,只有工作人员能看到。
豁免权。 拥有 bans.exempt 权限的玩家不会被惩罚。任何拥有 bans.exempt.bypass 权限的人仍可对其进行惩罚。
惩罚 ID。 每条惩罚都有一个显示在断开连接屏幕上的 ID。玩家在申诉时有据可查,管理员也有据可查。
SQLite 或 MySQL。 默认情况下,数据存储在本地文件中,无需额外设置。如果你运行多个服务器,可以让它们指向同一个 MySQL 数据库以共享惩罚记录。
| 命令 |
功能 |
/ban <player> [duration] [reason] [-s] |
封禁,永久或临时。别名:/tempban |
/mute <player> [duration] [reason] [-s] |
禁言。别名:/tempmute |
/warn <player> [duration] [reason] [-s] |
警告。别名:/tempwarn |
/kick <player> [reason] [-s] |
将玩家踢出服务器 |
/unban <player> [reason] |
解除封禁。别名:/pardon |
/unmute <player> [reason] |
解除禁言 |
/unwarn <player> [id] [reason] |
解除警告,默认解除最近的一条 |
/history <player> |
查看玩家的惩罚历史。别名:/punishments、/checkpunish |
/punishlog |
工作人员操作日志。别名:/banlog |
/bans reload |
重新加载配置文件和消息文本 |
/ban、/kick 和 /pardon 会覆盖原版命令。如果其他插件占用了相同名称,始终可以使用完整形式:/bans:ban、/bans:kick。
示例:
/ban Steve 7d Griefing spawn
/mute Alex 30m Spamming chat
/warn Notch Insulting other players -s
/unwarn Notch 14 Moderator mistake
玩家历史记录。 /history 打开一个菜单,展示所有惩罚记录:类型、原因、执行者、日期、时长及当前状态。你可以查看它是否仍然生效、是否已过期,或者是由谁解除的以及原因。
工作人员日志。 /punishlog 列出服务器上最新的操作,包括被惩罚的玩家和执行的操作员。这对于检查团队成员是否滥用权限非常有用。
这两个菜单都支持分页,并从主线程读取数据,因此打开它们不会消耗你的 Tick 时间。
config.yml 包含存储选择、默认原因、日期格式、禁言玩家不可用的命令列表以及升级规则:
escalation:
enabled: true
levels:
3: "MUTE 1h Reached 3 warnings"
5: "BAN 7d Reached 5 warnings"
7: "BAN perm Reached 7 warnings"
messages.yml 包含所有文本内容:聊天公告、封禁和踢出的断开连接界面文字、菜单中的标签等。它使用 MiniMessage 格式,因此颜色和渐变可以直接内联编写。原因和玩家名称在插入时不会解析标签,因此管理员无法通过原因文本破坏你的格式。
如果希望惩罚仅对工作人员可见,请设置 broadcast.public: false。此时每条惩罚都会表现得像是静默发出的。
| 权限节点 |
授予的功能 |
bans.ban, bans.mute, bans.warn, bans.kick |
执行相应的惩罚 |
bans.unban, bans.unmute, bans.unwarn |
解除惩罚 |
bans.history |
访问玩家的历史记录 |
bans.log |
访问工作人员日志 |
bans.notify |
接收公告,包括静默公告 |
bans.silent |
使用 -s 标志 |
bans.exempt |
免受惩罚 |
bans.exempt.bypass |
惩罚享有豁免权的玩家 |
bans.admin |
重新加载配置文件 |
安装
- 将 jar 文件放入
plugins 文件夹并重启服务器。
- 根据需要调整
config.yml 和 messages.yml,然后运行 /bans reload。
无需手动安装数据库驱动程序。服务器会在首次启动时自动下载所需的库。
要求: Paper 1.21 或更高版本,Java 21。基于 1.21 API 构建,并在 Paper 26.1.2 上经过测试。
Bans is a punishment system for Paper servers. Bans, mutes, warnings and kicks all live in one database, so a player's full record is available at any time, not only while they are online.
The plugin does not use the vanilla banned-players.json. Every punishment is a row with a reason, an author, the time it was issued and when it runs out, so nothing is lost once a ban is lifted.
Temporary and permanent punishments share one command. Pass a duration and you get a temporary punishment, leave it out and you get a permanent one. The usual formats work: 30m, 2h, 7d, 1d12h, perm.
Mutes actually hold. Chat is blocked and so are commands like /msg, /r and /me. The command list is configurable, so a muted player cannot route around the punishment through private messages.
Offline players can be punished. Anyone who has joined the server before can be banned, muted or warned without being online.
Automatic escalation. Once a player reaches a set number of active warnings, the plugin issues a mute or a ban on its own. Thresholds and actions are set in the config, and the whole thing can be turned off.
Silent punishments. Adding -s to a command hides the announcement from regular players. Only staff sees it.
Immunity. Players with bans.exempt cannot be punished. Anyone holding bans.exempt.bypass can punish them anyway.
Punishment ids. Every punishment has an id shown on the disconnect screen. The player has something to quote in an appeal and the moderator has something to look up.
SQLite or MySQL. By default everything sits in a local file and needs no setup. If you run several servers, point them at MySQL and they share one punishment database.
| Command |
What it does |
/ban <player> [duration] [reason] [-s] |
Ban, permanent or temporary. Alias: /tempban |
/mute <player> [duration] [reason] [-s] |
Mute. Alias: /tempmute |
/warn <player> [duration] [reason] [-s] |
Warn. Alias: /tempwarn |
/kick <player> [reason] [-s] |
Kick a player from the server |
/unban <player> [reason] |
Lift a ban. Alias: /pardon |
/unmute <player> [reason] |
Lift a mute |
/unwarn <player> [id] [reason] |
Lift a warning, the most recent one by default |
/history <player> |
A player's punishment history. Aliases: /punishments, /checkpunish |
/punishlog |
Staff action log. Alias: /banlog |
/bans reload |
Reload the config and messages |
/ban, /kick and /pardon override the vanilla ones. If another plugin claims the same names, the full form always works: /bans:ban, /bans:kick.
Examples:
/ban Steve 7d Griefing spawn
/mute Alex 30m Spamming chat
/warn Notch Insulting other players -s
/unwarn Notch 14 Moderator mistake
Player history. /history opens a menu with every punishment: type, reason, who issued it, date, length and current state. You can see whether it still applies, whether it ran out, or who lifted it and why.
Staff log. /punishlog lists the latest actions on the server together with the punished player and the moderator. Useful for checking that nobody on the team is leaning on their permissions.
Both menus are paginated and read their data off the main thread, so opening them does not cost you tick time.
config.yml holds the storage choice, the default reason, the date format, the list of commands a muted player cannot use, and the escalation rules:
escalation:
enabled: true
levels:
3: "MUTE 1h Reached 3 warnings"
5: "BAN 7d Reached 5 warnings"
7: "BAN perm Reached 7 warnings"
messages.yml holds every piece of text: chat announcements, the disconnect screens for bans and kicks, the labels inside the menus. It uses MiniMessage, so colours and gradients are written inline. Reasons and player names are inserted without parsing tags, so a moderator cannot break your formatting through the reason text.
If punishments should only be visible to staff, set broadcast.public: false. Every punishment then behaves as if it was issued silently.
| Permission |
What it grants |
bans.ban, bans.mute, bans.warn, bans.kick |
Issuing the matching punishments |
bans.unban, bans.unmute, bans.unwarn |
Lifting punishments |
bans.history |
Access to a player's history |
bans.log |
Access to the staff log |
bans.notify |
Receive announcements, silent ones included |
bans.silent |
Use the -s flag |
bans.exempt |
Cannot be punished |
bans.exempt.bypass |
Punish exempt players |
bans.admin |
Reload the config |
Installation
- Drop the jar into
plugins and restart the server.
- Adjust
config.yml and messages.yml if you need to, then run /bans reload.
There are no database drivers to install by hand. The server downloads the libraries it needs on first start.
Requirements: Paper 1.21 or newer, Java 21. Built against the 1.21 API and tested on Paper 26.1.2.
评论 0
登录后参与评分
还没有评论,来抢沙发吧