TabEvent
一个用于 Paper/Purpur 的插件,用于存储单个当前“事件消息”,并通过 PlaceholderAPI 占位符 %tabevent_message% 提供该消息。这允许你在 TAB(例如在页眉或页脚)中显示事件公告,而无需重新加载 TAB 或手动编辑配置文件。
要求
- Paper/Purpur 1.21+
- Java 21
- PlaceholderAPI
- TAB(用于显示占位符本身)
构建
该项目使用 Maven 进行构建。由于此环境中无法访问 Maven Central / PaperMC / ExtendedClip 仓库,因此无法在此处构建 jar 包 —— 请在本地或有网络访问权限的 CI 管道中进行构建:
mvn clean package
构建完成后,编译好的 jar 包将出现在 target/TabEvent.jar 中。
将其放入服务器的 plugins/ 目录并重启服务器(如果有可用的插件管理器热重载功能,也可以使用它)。
命令
所有命令都需要 tabevent.admin 权限(默认授予服务器操作员)。
| 命令 |
描述 |
/tabevent set <message> |
设置当前消息(支持 MiniMessage 标签) |
/tabevent clear |
将消息重置为配置中的 default-message 值(或空字符串) |
/tabevent get |
显示当前消息 |
/tabevent reload |
从磁盘重新加载 config.yml |
| `/tabevent lang <ru |
en>` |
示例:
/tabevent set <red>⚔ PvP starts in 10 minutes!
/tabevent set <gradient:red:gold>⚔ PvP in 10 minutes!
/tabevent clear
/tabevent get
/tabevent reload
/tabevent lang en
权限
tabevent.admin — 访问所有插件命令(默认:op)。
tabevent.bypasscooldown — 绕过 set/clear 命令的冷却时间(默认:op)。
配置
文件位置:plugins/TabEvent/config.yml
message: "<gray>No events today."
default-message: ""
cooldown-seconds: 5
language: ru
message — 当前激活的消息(使用 /tabevent set 和 /tabevent clear 时自动更新,保存到磁盘,并在服务器重启后恢复)。
default-message — 执行 /tabevent clear 时恢复的消息。
cooldown-seconds — 单个玩家修改消息(set/clear)之间的冷却时间(秒)。设置为 0 以禁用。控制台不受冷却限制,拥有 tabevent.bypasscooldown 权限的玩家也将绕过冷却。
language — 插件界面语言:ru 或 en。
多语言支持
命令消息(错误消息、确认信息等)位于单独的文件中:
plugins/TabEvent/lang/messages_ru.yml
plugins/TabEvent/lang/messages_en.yml
这些文件会在首次启动时使用内部模板自动生成。你可以自由编辑它们(包括添加 MiniMessage 格式化标签)—— 更改将在执行 /tabevent reload 或重启服务器后生效。
你可以通过两种方式切换界面语言:
- 动态命令:
/tabevent lang en(立即更新 config.yml 中的 language 并应用更改,无需重启)。
- 手动编辑:在
config.yml 中将 language: ru 更改为 language: en 并执行 /tabevent reload。
%tabevent_message% 占位符与配置的界面语言无关 —— 它始终返回通过 /tabevent set 设置的原始字符串,无论选择哪种界面语言。
日志记录
每次修改(set、clear、reload)都会以以下格式记录到 plugins/TabEvent/tabevent.log 中:
[2026-07-23 21:45:12] Steve: /tabevent set <red>⚔ PvP starts in 10 minutes!
[2026-07-23 21:50:03] Steve: /tabevent clear
[2026-07-23 22:01:44] CONSOLE: /tabevent reload
该日志文件会在启动时自动创建,并以追加模式更新,从而在服务器重启之间保留历史记录。
占位符
%tabevent_message%
按原样返回当前存储的消息,包括 MiniMessage 标签(例如 <red>⚔ PvP starts in 10 minutes!)。标签解析为实际颜色和格式由 TAB 直接处理(TAB 原生支持 MiniMessage),防止 TabEvent 剥离任何格式化标签。
TAB 中的用法示例
header-footer:
header:
- ""
- "%tabevent_message%"
- ""
执行 /tabevent set ... 后,TAB 中的页眉/页脚将在下一个 PlaceholderAPI 更新刻自动更新(无需执行 /tab reload)。
TabEvent
A plugin for Paper/Purpur that stores a single current "event message" and serves it via the PlaceholderAPI placeholder %tabevent_message%. This allows you to display event announcements in TAB (e.g., in the header or footer) without reloading TAB or manually editing configuration files.
Requirements
- Paper/Purpur 1.21+
- Java 21
- PlaceholderAPI
- TAB (to display the placeholder itself)
Building
The project is built using Maven. Since there is no internet access to Maven Central / PaperMC / ExtendedClip repositories in this environment, the jar could not be built here — build it locally (or in your CI pipeline) where internet access is available:
mvn clean package
After building, the compiled jar will appear in target/TabEvent.jar.
Place it into your server's plugins/ directory and restart the server (or use a plugin manager for hot-reloading if available).
Commands
All commands require the tabevent.admin permission (granted to server operators by default).
| Command |
Description |
/tabevent set <message> |
Set the current message (supports MiniMessage tags) |
/tabevent clear |
Reset the message to the default-message value from the config (or an empty string) |
/tabevent get |
Display the current message |
/tabevent reload |
Reload config.yml from disk |
| `/tabevent lang <ru |
en>` |
Examples:
/tabevent set <red>⚔ PvP starts in 10 minutes!
/tabevent set <gradient:red:gold>⚔ PvP in 10 minutes!
/tabevent clear
/tabevent get
/tabevent reload
/tabevent lang en
Permissions
tabevent.admin — Access to all plugin commands (default: op).
tabevent.bypasscooldown — Bypass the cooldown on set/clear commands (default: op).
Configuration
File location: plugins/TabEvent/config.yml
message: "<gray>No events today."
default-message: ""
cooldown-seconds: 5
language: ru
message — The current active message (updated automatically when using /tabevent set and /tabevent clear, saved to disk, and restored after server restarts).
default-message — The message restored when executing /tabevent clear.
cooldown-seconds — Cooldown period (in seconds) between message modifications (set/clear) for a single player. Set to 0 to disable. Cooldowns do not apply to the console, and players with the tabevent.bypasscooldown permission will bypass it.
language — The plugin UI language: ru or en.
Multi-Language Support
Command messages (error messages, confirmations, etc.) are located in separate files:
plugins/TabEvent/lang/messages_ru.yml
plugins/TabEvent/lang/messages_en.yml
These files are generated automatically on the first startup using internal templates. You can edit them freely (including adding MiniMessage formatting tags) — changes will take effect after executing /tabevent reload or restarting the server.
You can switch the interface language in two ways:
- Dynamic command:
/tabevent lang en (immediately updates language in config.yml and applies the change without a restart).
- Manual edit: Change
language: ru to language: en in config.yml and execute /tabevent reload.
The %tabevent_message% placeholder is independent of the configured UI language — it always returns the raw string set via /tabevent set, regardless of the selected interface language.
Logging
Every modification (set, clear, reload) is logged to plugins/TabEvent/tabevent.log using the following format:
[2026-07-23 21:45:12] Steve: /tabevent set <red>⚔ PvP starts in 10 minutes!
[2026-07-23 21:50:03] Steve: /tabevent clear
[2026-07-23 22:01:44] CONSOLE: /tabevent reload
This log file is created automatically on startup and is updated in append mode, preserving history across server restarts.
Placeholder
%tabevent_message%
Returns the current stored message as-is, including MiniMessage tags (e.g., <red>⚔ PvP starts in 10 minutes!). Tag parsing into actual color and formatting is handled directly by TAB (which natively supports MiniMessage), preventing TabEvent from stripping any formatting tags.
Usage Example in TAB
header-footer:
header:
- ""
- "%tabevent_message%"
- ""
After executing /tabevent set ..., the header/footer in TAB will update automatically on the next PlaceholderAPI update tick (without requiring a /tab reload).
评论 0
登录后参与评分
还没有评论,来抢沙发吧