WorldEaterNotifier
一款 Fabric 模组,用于监控世界吞噬者(World Eaters)和挖掘者(Trenchers),在它们停止或受阻时发送带有按事件控制提及的 Discord 通知。
这是什么?
一款 Fabric 模组,用于监控基于 TNT 的世界吞噬者(World Eaters)、挖掘者(Trenchers)以及基于方块破坏的黑曜石破碎机(Bedrock Breakers),在它们开始、停止或受阻时发送带有按事件控制提及和完全自定义消息的 Discord Webhook 通知。
文档
有关如何配置所有功能的完整指南,请访问文档:
WorldEaterNotifier Documentation
功能
- 实时监控:追踪世界吞噬者(TNT 数量)、挖掘者和黑曜石破碎机(方块破坏情况)。
- Discord 集成:当机器开始、停止、恢复或被手动停止时,立即发送通知。
- 可定制的消息:每种机器类型的每条通知消息均可通过 JSON 进行配置——使用
{type} 和 {name} 占位符。
- 基于角色的通知:提及特定的 Discord 角色,并支持按事件切换(全局、开始、手动停止、卡住、恢复、服务器关闭)。所有设置均可通过游戏内命令进行配置。
- Discord 机器人模式:基于 JDA 的机器人,具有交互式切换按钮和斜杠命令(
/config、/worldeater start|stop|list、/trencher start|stop|list、/bedrockbreaker start|stop|list),并支持自动补全。
- 可配置的阈值:每种机器类型的停止超时时间、最小 TNT 数量 / 最少破坏方块数。
- 多世界支持:监控不同维度中的机器。
- 持久化配置:机器定义、设置和提及开关在服务器重启后依然保留。消息可在 JSON 中编辑。
- 服务器关闭检测:在服务器关闭时自动停止所有活动机器,并通知 Discord。
安装
-
克隆仓库:
git clone https://github.com/CodeW4VE/WorldEaterNotifier.git
cd WorldEaterNotifier
-
构建模组:
./gradlew build
-
将生成的 .jar 文件从 build/libs/ 复制到服务器的 mods 文件夹:
cp build/libs/worldeaternotifier-*.jar /path/to/server/mods/
-
在服务器的 config 目录中创建一个 worldeaternotifier-config.json 文件,其中包含 Discord Webhook 和世界吞噬者设置。
配置
模组在首次运行时会在 config/worldeaternotifier.json 创建配置文件。你可以手动编辑它或使用游戏内命令。
示例:
{
"webhookUrl": "https://discord.com/api/webhooks/...",
"pingRoleId": "123456789012345678",
"notificationMode": "webhook",
"botToken": "",
"guildId": "",
"channelId": "",
"showSubscriptionButton": true,
"memberDiscordRole": "",
"worldEaterSettings": {
"stopTimeoutSeconds": 60,
"minTntCount": 3,
"pingSettings": {
"enabled": true,
"onStart": true,
"onStop": true,
"onStuck": true,
"onResumed": true,
"onShutdown": true
},
"messages": {
"start": "{type} **'{name}'** has started.",
"stuck": "{type} **'{name}'** has stopped due to an obstruction.",
"resumed": "{type} **'{name}'** has started again.",
"manualStop": "{type} **'{name}'** was stopped manually.",
"shutdown": "{type} **'{name}'** was shut down with the server and may have broken."
}
},
"trencherSettings": {
"stopTimeoutSeconds": 180,
"minBlocksBroken": 20,
"pingSettings": {
"enabled": true,
"onStart": true,
"onStop": true,
"onStuck": true,
"onResumed": true,
"onShutdown": true
},
"messages": {
"start": "{type} **'{name}'** has started.",
"stuck": "{type} **'{name}'** has stopped due to an obstruction.",
"resumed": "{type} **'{name}'** has started again.",
"manualStop": "{type} **'{name}'** was stopped manually.",
"shutdown": "{type} **'{name}'** was shut down with the server and may have broken."
}
},
"bedrockBreakerSettings": {
"stopTimeoutSeconds": 60,
"minBlocksBroken": 1,
"pingSettings": {
"enabled": true,
"onStart": true,
"onStop": true,
"onStuck": true,
"onResumed": true,
"onShutdown": true
},
"messages": {
"start": "{type} **'{name}'** has started.",
"stuck": "{type} **'{name}'** has stopped due to an obstruction.",
"resumed": "{type} **'{name}'** has started again.",
"manualStop": "{type} **'{name}'** was stopped manually.",
"shutdown": "{type} **'{name}'** was shut down with the server and may have broken."
}
},
"worldEaters": [],
"trenchers": [],
"bedrockBreakers": [],
"whitelist": []
}
- webhookUrl: Discord webhook URL。
- pingRoleId: 需要提及的 Discord 角色 ID。留空或设为
"0" 以禁用所有提及。
- notificationMode:
"webhook"(默认)或 "bot" —— 在 webhook 和 JDA 机器人模式之间切换。
- botToken: Discord 机器人令牌(机器人模式下必需)。
- guildId / channelId: 用于机器人通知和斜杠命令的 Discord 服务器和频道。
- showSubscriptionButton: 是否在开始消息中显示“切换 Ping”按钮(机器人模式下)。
- memberDiscordRole: 通过斜杠命令限制
/worldeater start|stop|list(以及 trencher/bedrockbreaker 等效命令)访问权限的 Discord 角色 ID;管理员始终拥有访问权限。
- stopTimeoutSeconds: 机器被视为卡住前,无活动状态的秒数。
- minTntCount / minBlocksBroken: 每次检查时保持机器存活所需的最小活动量。
- pingSettings: 每种机器类型的 Ping 开关设置(
enabled, onStart, onStop, onStuck, onResumed, onShutdown)—— 这些设置现在会在重启后保留。
- messages: 每种机器类型的自定义 Discord 通知消息。使用
{type} 表示机器类型名称,使用 {name} 表示机器实例名称。
使用方法
- 安装模组并启动服务器。
- 配置通知发送方式:
- Webhook 模式(默认):
/worldeater settings setWebhookUrl <url>
- 机器人模式:
/worldeater settings setBotToken <token>,设置 setGuildId 和 setChannelId,然后执行 /worldeater settings setNotificationMode bot
- 创建机器:
/worldeater create <name> <x1> <y1> <z1> <x2> <y2> <z2>
/trencher create <name> <x1> <y1> <z1> <x2> <y2> <z2>
/bedrockbreaker create <name> <x1> <y1> <z1> <x2> <y2> <z2>
(坐标会自动建议你所站立的方块;按 Tab 键补全名称。)
- 使用
/worldeater start <name>、/trencher start <name> 或 /bedrockbreaker start <name> 开始监控。
- 当机器意外停止(卡住)、恢复运行或被手动停止时,模组会自动发送 Discord 消息。
- 在机器人模式下,Discord 斜杠命令与 Minecraft 命令对应:
/worldeater start <name>、/worldeater stop <name>、/worldeater list(自动补全会建议现有名称)
/trencher 和 /bedrockbreaker 同理
/config pings —— 交互式流程,用于切换每种机器类型的 Ping 设置
- 动态调整设置:
/worldeater settings show、/trencher settings show、/bedrockbreaker settings show
/worldeater settings setStopTimeout <seconds>
/trencher settings setMinBlocksBroken <count>
/worldeater settings discordPings enable true 以及单独的事件如 onStuck false
/worldeater settings showSubscriptionButton <true|false>(机器人模式下)
/worldeater settings setMemberDiscordRole <roleId>(机器人模式下)
- 直接在 JSON 文件中编辑通知消息。
- 使用
Tab 键探索所有子命令。
- 管理机器:对所有三种类型均可使用
list、stop、delete。
- 当服务器关闭时,所有活跃的机器都会停止,并发送一条关机通知。
依赖项
从源码构建
需要:
- Gradle 8.10.2 或更高版本(通过 gradlew 自动下载)
- Java 21 或更高版本
构建命令:
./gradlew clean build
生成的文件:build/libs/worldeaternotifier-*.jar
许可证
MIT © froyln
WorldEaterNotifier
Fabric mod that monitors world eaters and trenchers, sending Discord notifications with per‑event ping control when they stop or get obstructed.
What is it?
Fabric mod that monitors world eaters (TNT-based), trenchers, and bedrock breakers (block destruction-based), sending Discord webhook notifications with per‑event ping control and fully customizable messages when they stop, start, or get obstructed.
Documentation
For a complete guide on how to configure all the features please visit the documentation:
WorldEaterNotifier Documentation
Features
- Real-time monitoring: Tracks world eaters (TNT count), trenchers, and bedrock breakers (block destruction).
- Discord integration: Sends instant notifications when a machine starts, stops, resumes, or is manually stopped.
- Customizable messages: Every notification message is configurable per machine type via JSON — use
{type} and {name} placeholders.
- Role-based notifications: Mention specific Discord roles with per‑event toggles (global, start, manual stop, stuck, resumed, server shutdown). All configurable in‑game via commands.
- Discord bot mode: JDA-powered bot with interactive toggle button and slash commands (
/config, /worldeater start|stop|list, /trencher start|stop|list, /bedrockbreaker start|stop|list) with autocomplete.
- Configurable thresholds: Stop timeout, minimum TNT count / blocks broken per machine type.
- Multi-world support: Monitor machines across different dimensions.
- Persistent configuration: Machine definitions, settings, and ping toggles survive server restarts. Messages are editable in JSON.
- Server shutdown detection: Automatically stops all active machines on shutdown and notifies Discord.
Installation
-
Clone the repository:
git clone https://github.com/CodeW4VE/WorldEaterNotifier.git
cd WorldEaterNotifier
-
Build the mod:
./gradlew build
-
Copy the generated .jar file from build/libs/ to your server's mods folder:
cp build/libs/worldeaternotifier-*.jar /path/to/server/mods/
-
Create a worldeaternotifier-config.json file in your server's config directory with Discord webhook and world eater settings.
Configuration
The mod creates config/worldeaternotifier.json on first run. You can edit it manually or use the in‑game commands.
Example:
{
"webhookUrl": "https://discord.com/api/webhooks/...",
"pingRoleId": "123456789012345678",
"notificationMode": "webhook",
"botToken": "",
"guildId": "",
"channelId": "",
"showSubscriptionButton": true,
"memberDiscordRole": "",
"worldEaterSettings": {
"stopTimeoutSeconds": 60,
"minTntCount": 3,
"pingSettings": {
"enabled": true,
"onStart": true,
"onStop": true,
"onStuck": true,
"onResumed": true,
"onShutdown": true
},
"messages": {
"start": "{type} **'{name}'** has started.",
"stuck": "{type} **'{name}'** has stopped due to an obstruction.",
"resumed": "{type} **'{name}'** has started again.",
"manualStop": "{type} **'{name}'** was stopped manually.",
"shutdown": "{type} **'{name}'** was shut down with the server and may have broken."
}
},
"trencherSettings": {
"stopTimeoutSeconds": 180,
"minBlocksBroken": 20,
"pingSettings": {
"enabled": true,
"onStart": true,
"onStop": true,
"onStuck": true,
"onResumed": true,
"onShutdown": true
},
"messages": {
"start": "{type} **'{name}'** has started.",
"stuck": "{type} **'{name}'** has stopped due to an obstruction.",
"resumed": "{type} **'{name}'** has started again.",
"manualStop": "{type} **'{name}'** was stopped manually.",
"shutdown": "{type} **'{name}'** was shut down with the server and may have broken."
}
},
"bedrockBreakerSettings": {
"stopTimeoutSeconds": 60,
"minBlocksBroken": 1,
"pingSettings": {
"enabled": true,
"onStart": true,
"onStop": true,
"onStuck": true,
"onResumed": true,
"onShutdown": true
},
"messages": {
"start": "{type} **'{name}'** has started.",
"stuck": "{type} **'{name}'** has stopped due to an obstruction.",
"resumed": "{type} **'{name}'** has started again.",
"manualStop": "{type} **'{name}'** was stopped manually.",
"shutdown": "{type} **'{name}'** was shut down with the server and may have broken."
}
},
"worldEaters": [],
"trenchers": [],
"bedrockBreakers": [],
"whitelist": []
}
- webhookUrl: Discord webhook URL.
- pingRoleId: ID of the Discord role to mention. Leave empty or
"0" to disable all mentions.
- notificationMode:
"webhook" (default) or "bot" — switches between webhook and JDA bot delivery.
- botToken: Discord bot token (required for bot mode).
- guildId / channelId: Discord guild and channel for bot notifications and slash commands.
- showSubscriptionButton: Whether to show the "Toggle Ping" button on start messages (bot mode).
- memberDiscordRole: Discord role ID that gates
/worldeater start|stop|list (and trencher/bedrockbreaker equivalents) via slash commands; admins always have access.
- stopTimeoutSeconds: How many seconds without activity before the machine is considered stuck.
- minTntCount / minBlocksBroken: Minimum activity per check to keep the machine alive.
- pingSettings: Per-machine-type ping toggles (
enabled, onStart, onStop, onStuck, onResumed, onShutdown) — these now persist across restarts.
- messages: Customizable Discord notification messages per machine type. Use
{type} for the machine type name and {name} for the machine instance name.
Usage
- Install the mod and start your server.
- Configure delivery:
- Webhook mode (default):
/worldeater settings setWebhookUrl <url>
- Bot mode:
/worldeater settings setBotToken <token>, set setGuildId and setChannelId, then /worldeater settings setNotificationMode bot
- Create machines:
/worldeater create <name> <x1> <y1> <z1> <x2> <y2> <z2>
/trencher create <name> <x1> <y1> <z1> <x2> <y2> <z2>
/bedrockbreaker create <name> <x1> <y1> <z1> <x2> <y2> <z2>
(Coordinates auto‑suggest the block you stand on; Tab completes names.)
- Start monitoring with
/worldeater start <name>, /trencher start <name>, or /bedrockbreaker start <name>.
- The mod automatically sends Discord messages when a machine stops unexpectedly (stuck), resumes, or is manually stopped.
- In bot mode, Discord slash commands mirror the Minecraft commands:
/worldeater start <name>, /worldeater stop <name>, /worldeater list (autocomplete suggests existing names)
- Same for
/trencher and /bedrockbreaker
/config pings — interactive flow to toggle per-machine-type ping settings
- Adjust settings on the fly:
/worldeater settings show, /trencher settings show, /bedrockbreaker settings show
/worldeater settings setStopTimeout <seconds>
/trencher settings setMinBlocksBroken <count>
/worldeater settings discordPings enable true and individual events like onStuck false
/worldeater settings showSubscriptionButton <true|false> (bot mode)
/worldeater settings setMemberDiscordRole <roleId> (bot mode)
- Edit notification messages directly in the JSON file.
- Use
Tab to explore all subcommands.
- Manage machines:
list, stop, delete for all three types.
- When the server shuts down, all active machines are stopped and a shutdown notification is sent.
Dependencies
Building from Source
Requires:
- Gradle 8.10.2 or higher (automatically downloaded via gradlew)
- Java 21 or higher
Build command:
./gradlew clean build
Generated artifact: build/libs/worldeaternotifier-*.jar
License
MIT © froyln
评论 0
登录后参与评分
还没有评论,来抢沙发吧