SerendiClear
SerendiClear 是一款适用于 Minecraft 26.2+ 的服务端 Fabric 模组,用于保持世界整洁——自动移除掉落物并限制生物堆叠——同时提供 BossBar 倒计时和便捷的垃圾桶图形用户界面(GUI),物品在被清除前会暂存于此。
功能特性
- ? 自动清理 — 可配置的间隔时间(默认:每 30 分钟)扫描并清除掉落物和多余生物。
- ⏲️ BossBar 倒计时 — 在清理开始前,向所有玩家显示可视化的 BossBar 警告(默认:60 秒)。
- ?️ 垃圾桶 GUI — 被移除的物品会存储在分页的箱子 GUI 中(
/垃圾桶),以便玩家找回。
- ? 生物堆叠限制 — 限制配置半径内相同类型生物的数量(默认:每 16 格方块内 ≤24 个)。
- ?️ 智能保护 — 命名实体/物品以及配置的保护物品 ID 永远不会被移除。
- ? 多世界支持 — 可针对特定世界或一次性处理所有世界。
- ? 手动触发 —
/serendiclear clear 按需启动清理流程。
- ⚙️ 热重载配置 —
/serendiclear reload 无需重启服务器即可应用配置更改。
- ? 纯服务端 — 无需安装客户端模组。
命令
| 命令 |
权限 |
描述 |
/serendiclear clear |
commands.gamemaster |
手动启动清理倒计时 |
/serendiclear reload |
commands.gamemaster |
从磁盘重新加载配置文件 |
/垃圾桶 |
(所有人) |
打开垃圾桶 GUI 以取回收集到的物品 |
命令 /垃圾桶 是中文“垃圾桶”的意思。在未来的版本中可以设置别名或修改该命令。
配置
配置文件位于 config/serendiclear.json。首次运行时会根据默认值自动生成。
常规选项
| 选项 |
类型 |
默认值 |
描述 |
worlds |
string[] |
["all"] |
需要清理的世界。设置为 ["all"] 表示所有维度,或列出特定世界(例如 ["minecraft:overworld"])。 |
intervalMinutes |
int |
30 |
自动清理之间的间隔时间(分钟)。最小值:1。 |
broadcastSeconds |
int |
60 |
倒计时持续时间(秒)。设置为 0 则立即清理。 |
prefix |
string |
"§9SerendiClear >> " |
聊天消息中使用的前缀。 |
bossbarTitle |
string |
"§e即将清理!倒计时: §c{time} §e秒" |
BossBar 标题。{time} 会被替换为剩余秒数。 |
物品与生物选项
| 选项 |
类型 |
默认值 |
描述 |
clearDrops |
bool |
true |
是否移除散落的物品实体。 |
clearMobs |
bool |
true |
是否强制执行生物堆叠限制。 |
maxMobStack |
int |
24 |
在 mobStackRadius 范围内允许的相同生物类型的最大数量。 |
mobStackRadius |
int |
16 |
检测生物堆叠的半径(以方块为单位)。 |
protectNamed |
bool |
true |
是否跳过已命名的实体或重命名的物品堆栈。 |
protectedItems |
string[] |
[] |
永不移除的物品 ID(例如 ["minecraft:diamond", "minecraft:netherite_ingot"])。 |
垃圾桶选项
| 选项 |
类型 |
默认值 |
描述 |
trashEnabled |
bool |
true |
启用垃圾桶。关闭后,掉落物将被直接删除。 |
trashMaxPages |
int |
5 |
垃圾桶的最大页数(每页是一个 54 格的箱子大小网格)。 |
trashTitle |
string |
"§9§l垃圾桶 §7(第{page}/{max}页)" |
垃圾桶 GUI 的标题。{page} 和 {max} 是占位符。 |
trashOpenButton |
string |
"§e§l【点我打开垃圾桶】" |
清理后发送的可点击聊天消息。 |
trashExcludedWorlds |
string[] |
[] |
不发送垃圾桶消息的世界列表。 |
当垃圾桶空间不足(所有页面已满)时,它会自动清空并重新开始。发生此情况时会广播通知。
安装
- 为 Minecraft 26.2+ 安装 Fabric Loader。
- 将
SerendiClear-<version>.jar 放入服务器的 mods/ 文件夹中。
- 启动服务器——该模组为纯服务端,无需客户端模组。
- 根据需要配置
config/serendiclear.json(它会自动生成)。
依赖项
- Fabric API(任何与你 Minecraft 版本兼容的版本)
- Minecraft 26.2+
工作原理
- Tick 循环 — 每个服务器 Tick,模组检查是否已过去
intervalMinutes 分钟。
- 倒计时 — 触发后,出现 BossBar 并倒计时
broadcastSeconds 秒。在此期间,玩家可以使用 /垃圾桶。
- 清理 — 模组遍历目标世界中所有已加载的区块:
- 掉落物:移除受保护的
ItemEntity 实例并将其存储在垃圾桶中。
- 生物:按类型对活体实体进行分组,在
mobStackRadius 内查找集群,并移除最远的多余成员,直到集群满足 maxMobStack 的限制。
- 垃圾桶通知 — 清理完成后,发送一个可点击的聊天按钮,邀请玩家打开垃圾桶并找回他们的物品。
权限系统
该模组使用 Fabric API 内置的权限 API,级别为 commands.gamemaster。拥有操作员状态(或通过权限模组授予此权限)的玩家可以使用管理命令。
许可证
本项目根据 MIT License 授权。
SerendiClear
SerendiClear is a server-side Fabric mod for Minecraft 26.2+ that keeps your world clean — automatically removing dropped items and limiting mob stacking — all with a BossBar countdown and a convenient trash-bin GUI where items go before they vanish.
Features
- ? Auto-cleanup — Configurable interval (default: every 30 minutes) sweeps item drops and excess mobs.
- ⏲️ BossBar Countdown — A visible BossBar warns all players before a cleanup (default: 60 seconds).
- ?️ Trash Bin GUI — Removed items are stored in a paginated chest GUI (
/垃圾桶) so players can reclaim them.
- ? Mob Stack Limiting — Limits the number of the same mob type within a configurable radius (default: ≤24 per 16 blocks).
- ?️ Smart Protection — Named entities/items and configurable item IDs are never removed.
- ? Multi-world — Target specific worlds or all worlds at once.
- ? Manual Trigger —
/serendiclear clear starts a cleanup on demand.
- ⚙️ Hot-Reloadable Config —
/serendiclear reload applies config changes without a restart.
- ? Pure Server-Side — No client-side installation needed.
Commands
| Command |
Permission |
Description |
/serendiclear clear |
commands.gamemaster |
Manually start the cleanup countdown |
/serendiclear reload |
commands.gamemaster |
Reload the config file from disk |
/垃圾桶 |
(everyone) |
Open the trash bin GUI to retrieve collected items |
The command /垃圾桶 is the Chinese word for "trash can." It can be aliased or changed in a future version.
Configuration
The config file is located at config/serendiclear.json. It is auto-generated with defaults on first run.
General Options
| Option |
Type |
Default |
Description |
worlds |
string[] |
["all"] |
Worlds to clean. Set to ["all"] for all dimensions, or list specific ones (e.g. ["minecraft:overworld"]). |
intervalMinutes |
int |
30 |
Interval between automatic cleanups (minutes). Minimum: 1. |
broadcastSeconds |
int |
60 |
Countdown duration in seconds. Set to 0 for instant cleanup. |
prefix |
string |
"§9SerendiClear >> " |
Message prefix used in chat. |
bossbarTitle |
string |
"§e即将清理!倒计时: §c{time} §e秒" |
BossBar title. {time} is replaced with the remaining seconds. |
Item & Mob Options
| Option |
Type |
Default |
Description |
clearDrops |
bool |
true |
Whether to remove loose item entities. |
clearMobs |
bool |
true |
Whether to enforce the mob stacking limit. |
maxMobStack |
int |
24 |
Maximum number of the same mob type allowed within mobStackRadius. |
mobStackRadius |
int |
16 |
Radius (in blocks) to detect stacked mobs. |
protectNamed |
bool |
true |
Whether named entities or renamed item stacks are skipped. |
protectedItems |
string[] |
[] |
Item IDs to never remove (e.g. ["minecraft:diamond", "minecraft:netherite_ingot"]). |
Trash Bin Options
| Option |
Type |
Default |
Description |
trashEnabled |
bool |
true |
Enable the trash bin. When off, dropped items are simply deleted. |
trashMaxPages |
int |
5 |
Maximum number of trash bin pages (each page is a chest-size 54-slot grid). |
trashTitle |
string |
"§9§l垃圾桶 §7(第{page}/{max}页)" |
Title of the trash GUI. {page} and {max} are placeholders. |
trashOpenButton |
string |
"§e§l【点我打开垃圾桶】" |
Clickable chat message sent after a cleanup. |
trashExcludedWorlds |
string[] |
[] |
Worlds where no trash-bin message is sent. |
When the trash bin runs out of space (all pages full), it auto-clears and starts fresh. A notification is broadcast when this happens.
Installation
- Install Fabric Loader for Minecraft 26.2+.
- Place the
SerendiClear-<version>.jar into your server's mods/ folder.
- Start the server — the mod is pure server-side and needs no client-side mod.
- Configure
config/serendiclear.json to your liking (it generates automatically).
Dependencies
- Fabric API (any version compatible with your Minecraft)
- Minecraft 26.2+
How It Works
- Tick loop — Every server tick, the mod checks if
intervalMinutes have elapsed.
- Countdown — When triggered, a BossBar appears and counts down for
broadcastSeconds. Players can use /垃圾桶 in the meantime.
- Cleanup — The mod iterates all loaded chunks in the target worlds:
- Drops: Removes unprotected
ItemEntity instances and stores them in the trash bin.
- Mobs: Groups living entities by type, finds clusters within
mobStackRadius, and removes the farthest excess members until the cluster meets maxMobStack.
- Trash notification — After cleanup, a clickable chat button invites players to open the trash bin and reclaim their items.
Permission System
The mod uses Fabric API's built-in permission API at the commands.gamemaster level. Players with operator status (or granted this permission via a permission mod) can use the administrative commands.
License
This project is licensed under the MIT License.
评论 0
登录后参与评分
还没有评论,来抢沙发吧