⚙️ BetterSettings
适用于 Paper 的可靠玩家设置——一个图形界面、自定义定义、可选值以及安全的重载机制。

一个设置菜单,两种布局
BetterSettings 为玩家提供了一个集中管理服务器偏好的地方,同时为管理员和插件开发者提供了稳定的扩展点。
- 经典预设: 保留了现有的分类菜单工作流程。
- 甜甜圈灵感预设: 一个可选的包含 54 个槽位的标签式库存,设有聊天、通知、PvP、视觉、隐私、记分板和常规等标签页。
- 清晰的控制: 左键点击切换或推进选项,右键点击选择上一个选项,Shift+左键点击恢复配置的默认值。
- 能力感知: 基于提供者的条目在实现它们的插件注册行为之前保持隐藏。空标签页也会被隐藏。

“甜甜圈灵感”预设在一个标准的 Paper 库存内重现了有用的设置组织结构。它与 DonutSMP 无关,也不复制其暂停屏幕界面。
开关和选项设置
版本 1.1 添加了类型化的值,同时不会破坏原始的布尔 API。
- 开关(Toggles)仍为 YAML 布尔值。
- 选项(Choices)以字符串形式持久化,可以双向循环切换。
- 无效的存储选项会安全地回退到配置的默认值。
- 布尔值更改会继续触发旧版事件以及新的类型化值事件。

上图显示的选项是一个自定义演示定义,并非捆绑的服务器功能。
可随重载保留的自定义设置
自定义 YAML 支持:
settings/*.yml 根目录下的单个设置;
- 一个文件中的多个命名设置;或
- 一个命名块(如
Test:),带有可选的显式 id。
未知的分类将显示在 Uncategorized(未分类)下并附带警告。无效的材料将回退到 PAPER 并通过验证报告。重复的 ID 和无效的定义将在验证阶段失败,而不是静默替换另一个设置。
重载是原子的:有问题的候选者不会干扰当前运行的实时菜单。由其他插件注册的设置和行为在 YAML 重载后得以保留。
动作与集成
自定义设置可以运行经过验证的提交后动作:
- 发送玩家消息;
- 执行玩家命令;或
- 执行控制台命令。
命令的效果尽最大努力执行,因为目标插件拥有其行为逻辑。
“甜甜圈灵感”目录包括用于拍卖警报、赏金警报、支付政策、物品价值描述、显示等级、快速水晶和记分板行的通用基于提供者的条目。只有在提供者注册了匹配的行为后,BetterSettings 才会显示它们。
原生行为
BetterSettings 拥有的行为包括聊天和玩家可见性、个人时间与天气、保护偏好、移动和药水风格模式、自动重生、物品拾取、碰撞以及相关 Paper 原生控制。活动目录和可用性计数是根据您服务器上加载的定义动态生成的,而非固定的营销数字。
命令
| 命令 |
用途 |
权限 |
/settings |
打开设置菜单 |
bettersettings.use |
/settings reload |
验证并原子重载 |
bettersettings.reload |
/settings info |
显示活动预设和注册表计数 |
bettersettings.info |
/settings validate |
显示已加载、不可用、跳过、重复和无效的数量 |
bettersettings.validate |
开发者 API
原始的 Setting、SettingsRegistry.registerSetting(...)、布尔数据方法和布尔事件仍然可用。版本 1.1 新增了 ValueSetting、SettingType、SettingOption、SettingBehavior、字符串值方法、类型化注册以及 PlayerSettingValueChangeEvent。
SettingsRegistry.getInstance().registerSetting(new MyCustomSetting());
要求与兼容性
- Java 21 或更高版本
- Paper 1.20.5 或更高版本
- 无需第三方插件
相同的 Java 21 制品已在 Java 21 环境下的 Paper 1.20.5 以及 Java 25 环境下的稳定版 Paper 26.2 上进行了测试。由于 Folia 的完整运行时旅程尚未得到验证,因此 1.1 版本未宣传对其支持。Paper 26.3 目前仅作为实验性的冒烟测试目标,而非宣传的稳定支持。
从 1.0 升级
- 按照正常的操作规范备份
plugins/BetterSettings/ 目录。
- 用
BetterSettings-1.1.0.jar 替换旧的 JAR 文件。
- 保持现有的配置文件和玩家数据文件不变。
- 重启服务器并运行
/settings validate。
现有文件不会被覆盖。现有的布尔型玩家值保持为布尔值,活动预设默认为 classic,新捆绑的文件仅在缺失时进行复制。
支持
⚙️ BetterSettings
Reliable player settings for Paper — one GUI, custom definitions, choice values, and safe reloads.

One settings menu, two layouts
BetterSettings gives players one place to manage server preferences while giving owners and plugin developers a stable extension point.
- Classic preset: preserves the existing category-menu workflow.
- Donut-inspired preset: an opt-in 54-slot tabbed inventory with Chat, Notifications, PvP, Visuals, Privacy, Scoreboard, and General tabs.
- Clear controls: left-click toggles or advances, right-click selects the previous choice, and shift-click restores the configured default.
- Capability-aware: provider-backed entries stay hidden until the plugin that implements them registers a behavior. Empty tabs are hidden too.

The Donut-inspired preset recreates the useful settings organization inside a normal Paper inventory. It is not affiliated with DonutSMP and does not copy its pause-screen interface.
Toggle and choice settings
Version 1.1 adds typed values without breaking the original boolean API.
- Toggles remain YAML booleans.
- Choices persist as strings and can be cycled in either direction.
- Invalid stored choices safely resolve to the configured default.
- Boolean changes continue to fire the legacy events as well as the new typed value event.

The choice shown above is a custom demonstration definition, not a bundled server feature.
Custom settings that survive reloads
Custom YAML accepts:
- a single setting at the root of
settings/*.yml;
- several named settings in one file; or
- a named block such as
Test: with an optional explicit id.
Unknown categories appear under Uncategorized with a warning. Invalid materials fall back to PAPER and are reported by validation. Duplicate IDs and invalid definitions fail validation instead of silently replacing another setting.
Reloads are atomic: a bad candidate keeps the current live menu running. Settings and behaviors registered by other plugins survive YAML reloads.
Actions and integrations
Custom settings can run validated post-commit actions:
- send a player message;
- run a player command; or
- run a console command.
Command effects are best-effort because the destination plugin owns their behavior.
The Donut-inspired catalog includes generic provider-backed entries for auction alerts, bounty alerts, payment policy, item-worth lore, display rank, fast crystals, and scoreboard lines. BetterSettings only shows them after a provider registers the matching behavior.
Native behavior
BetterSettings-owned behavior includes chat and player visibility, personal time and weather, protection preferences, movement and potion-style modes, auto-respawn, item pickup, collision, and related Paper-native controls. The active catalog and availability counts are derived from the definitions loaded on your server rather than a fixed marketing number.
Commands
| Command |
Purpose |
Permission |
/settings |
Open the settings menu |
bettersettings.use |
/settings reload |
Validate and atomically reload |
bettersettings.reload |
/settings info |
Show the active preset and registry counts |
bettersettings.info |
/settings validate |
Show loaded, unavailable, skipped, duplicate, and invalid counts |
bettersettings.validate |
Developer API
The original Setting, SettingsRegistry.registerSetting(...), boolean data methods, and boolean events remain available. Version 1.1 adds ValueSetting, SettingType, SettingOption, SettingBehavior, string value methods, typed registration, and PlayerSettingValueChangeEvent.
SettingsRegistry.getInstance().registerSetting(new MyCustomSetting());
Requirements and compatibility
- Java 21 or newer
- Paper 1.20.5 or newer
- No required third-party plugins
The same Java 21 artifact was exercised on Paper 1.20.5 with Java 21 and stable Paper 26.2 with Java 25. Folia is not advertised for 1.1 because its complete runtime journey has not been verified. Paper 26.3 remains an experimental smoke target rather than advertised stable support.
Upgrade from 1.0
- Back up
plugins/BetterSettings/ as normal operational hygiene.
- Replace the old JAR with
BetterSettings-1.1.0.jar.
- Keep the existing configuration and player-data files in place.
- Restart the server and run
/settings validate.
Existing files are not overwritten. Existing boolean player values remain booleans, the active preset defaults to classic, and newly bundled files are copied only when missing.
Support
评论 0
登录后参与评分
还没有评论,来抢沙发吧