NodeRunner 🚀
在你的 Minecraft 服务器内直接运行你的 Node.js Discord 机器人 —— 无需 VPS,无需额外托管,无需 SSH。
NodeRunner 是一个 Paper 插件,它将一个 Node.js 进程作为你 Minecraft 服务器的子进程进行管理。它自动处理一切:下载 Node.js、安装依赖项、崩溃后重启、通过 Web 仪表板实时流式传输日志以及发送 Discord 通知 —— 所有这些都只需一个 config.yml。
🆕 1.5.2 新功能:平台修复
修复
- 已修复:32 位 ARM Linux(例如旧版 Raspberry Pi OS)会下载无法在其上运行的 x64 版本 Node.js。现在它会获取 ARM 版本。支持该架构的最新 Node.js 版本为 22,因此它将安装该版本。
- 已修复:Windows 上的
npm install 失败,当服务器文件夹路径包含 (、)、& 或 % 时(例如位于 Program Files (x86) 下的路径)。现在 npm 直接通过 Node.js 运行,而不是通过 cmd.exe。
还包含来自 1.5.1 的可靠性与安全修复
如果你从 spidey.in 下载了 1.5.0 版本,请进行更新: 其仪表板在登录后无法正常工作。Modrinth 上的 1.5.0 版本与 1.5.1 版本的代码相同,仅版本号不同。
安全
- 新安装将生成随机仪表板密码,并在控制台中打印一次,且仅监听
127.0.0.1。在此之前,每个安装都在所有网络接口上使用 changeme。现有安装保留其设置,所以如果你的仍然是 changeme,请立即更改它。
- 已修复:登录锁定可以被绕过,通过同时发送大量猜测,并且隧道后面陌生人的错误猜测可能会将你锁定。
- 已修复:过大的登录请求会占用服务器内存。
- 已修复:
/nodebot logs 将机器人输出视为格式化聊天,因此你的机器人记录的一条消息可能变成可点击的命令。日志行现在是纯文本。
- 已修复:机器人的入口文件或名称可能指向插件自身文件夹之外。
机器人
- 已修复:一个机器人在安装期间的 Start 之后,或者 Stop 然后 Start 之后,可能会运行两次,而 Stop 无法到达第二个副本。
- 已修复:手动运行
npm install 会使机器人卡在 INSTALLING 状态。
- 已修复:拼写错误的机器人名称会对你的第一个机器人生效。
- 已修复:将机器人重命名为已存在的名称会使旧机器人继续运行,没有任何内容跟踪它,并且编辑正在运行的机器人可能会在旧机器人停止之前启动新机器人。
- 已修复:如果快速连续触发两次,重启可能会静默地什么都不做。
- 现在可以检测到无法在你的服务器上运行的 Node.js。 当前的 LTS 版本 Node 26 需要
libatomic,许多 Minecraft Docker 镜像缺乏该库。NodeRunner 会对每个下载进行测试运行,如果没有 libatomic 则回退到上一个 LTS 版本,并修复已经损坏的安装。更改 node-version 无需删除任何内容即可生效。
- 已修复:损坏的下载归档文件在 Windows 上可能会将其文件提取到其文件夹之外。
- 命令不再使用仅 Paper 拥有的类,Spigot 和 Bukkit 没有这些类。
仪表板
- 已修复:编辑机器人可能会丢失其环境变量,包括机器人令牌。
- 已修复:在机器人输出繁重时,实时控制台可能会变空白,并且在 cloudflared 快速隧道后面永远不会更新。
- 已修复:设置页面从未显示你实际保存的设置。
- 已修复:包含撇号的机器人名称会破坏该机器人卡片上的所有按钮。
- 当你的会话结束时,仪表板返回到登录页面。
✨ 功能
⚡ 零接触 Node.js 设置
你的服务器上没有 Node.js?没问题。NodeRunner 会自动检测你的操作系统和 CPU 架构,并在首次启动时下载能在你的服务器上运行的最新 Node.js LTS。每次下载都会进行测试运行,如果缺少 libatomic 等内容,则回退到上一个 LTS 版本。适用于 Linux (x64, ARM64 & 32 位 ARM)、macOS 和 Windows,并且之后会缓存。
📦 自动依赖项安装
有了 package.json?每当缺少 node_modules 时,NodeRunner 会在启动前自动运行 npm install。无需人工干预。
🔁 崩溃恢复与循环保护
你的机器人受到持续监控。发生崩溃时,NodeRunner 会等待一段可配置的延迟时间并重新启动它。如果在短时间内崩溃次数过多,崩溃循环保护将停止重试并向你发出警报 —— 不会无限重启刷屏。
🖥️ 实时 Web 仪表板
一个内置的、受密码保护的控制面板,可通过任何浏览器访问:
- 通过服务器发送事件 (SSE) 实时流式传输日志(无需刷新页面)
- 开始 / 停止 / 重启 / npm install 按钮
- 实时状态、正常运行时间、PID、重启计数和内存使用情况
- stdin 输入栏 —— 直接向机器人进程发送命令
- 多机器人选择器 —— 从仪表板切换机器人(自动检测)
- 带自动滚动切换的颜色编码日志输出
- 所有修改端点的 CSRF 保护
- 暴力登录保护 —— 每个访客在 5 次尝试失败后锁定,即使位于隧道后面也是如此
🔔 Discord Webhook 通知
当你的机器人启动、停止、崩溃或运行 npm install 时,通过标准 webhook URL 在 Discord 中收到通知。不需要机器人令牌。每种事件类型均可单独切换。
🎮 游戏内命令
通过 /nodebot 从 Minecraft 控制台或游戏内完全控制。无需 SSH 会话即可重启你的机器人。
🤖 多机器人支持
同时运行多个 Node.js 机器人 —— 每个机器人都有自己独立的进程、日志文件和独立的崩溃恢复机制。通过 /nodebot start <name>、/nodebot stop <name> 等命令单独控制每个机器人。
📌 Node.js 版本固定
固定特定的 Node.js 主要版本(例如 "22"),而不是你在服务器上运行的最新版本 LTS。如果你的机器人需要特定的运行时版本,这很有用。
💻 stdin 直通
从 Web 仪表板直接向机器人进程发送输入,而无需重启它 —— 对于通过 stdin 接受控制台命令的机器人非常有用。
📊 内存监控
Web 仪表板显示来自 Linux /proc/<pid>/status 的机器人进程实时内存使用量(RSS)。
🔗 TunnelMC 集成
如果安装了 TunnelMC 且仪表板端口上有活动的隧道,NodeRunner 会在机器人启动时将公共 URL 打印到控制台——仅供参考,TunnelMC 绝不会自动启动。
🐋 Pterodactyl 兼容
已在 Pterodactyl 面板上完全测试。使用 .tar.gz 进行 Node.js 解压(无需 xz 依赖),并将 node 二进制文件正确注入到进程 PATH 中,以兼容容器内的 npm。
📥 安装
- 将
NodeRunner.jar 放入你的 plugins/ 文件夹
- 启动服务器一次以生成配置文件
- 将你的机器人代码放在
plugins/NodeRunner/bot/ 中(需要 index.js + package.json)
- 在
config.yml 的 env: 下设置你的机器人令牌和其他密钥
- 重启,或运行
/nodebot start
NodeRunner 处理其余部分——Node.js 下载、npm install 和机器人启动均自动完成。
📂 文件结构
plugins/
NodeRunner/
config.yml ← 所有插件设置
bot/ ← 你的机器人代码放在这里
index.js
package.json
logs/
bot.log ← 实时输出(5MB 轮换,保留 3 个备份)
bot-<name>.log ← 使用多个机器人时的每个机器人日志文件
nodejs/ ← 自动下载的 Node.js 二进制文件(请勿触碰)
🎮 命令与权限
权限: noderunner.admin (默认:OP)
| 命令 |
描述 |
/nodebot start [name] |
启动机器人(或通过名称指定特定机器人) |
/nodebot stop [name] |
停止机器人(或通过名称指定特定机器人) |
/nodebot restart [name] |
重启机器人(或通过名称指定特定机器人) |
/nodebot status [name] |
显示所有机器人或特定机器人的状态 |
/nodebot install [name] |
强制重新运行 npm install |
/nodebot reload |
重载 config.yml |
🌐 Web 仪表板
仪表板监听 http://127.0.0.1:8080(端口可配置),因此默认情况下只有服务器本机可以打开它。要从其他位置访问:
- 使用隧道,如 TunnelMC 或 Cloudflare Tunnel(无需额外端口),或
- 设置
dashboard.bind-address: "0.0.0.0" 并打开 http://<your-server-ip>:8080
它具有密码保护。随机密码在首次启动时生成,仅在控制台中打印一次,并保存在 config.yml 中。
Pterodactyl 用户: 0.0.0.0 还需要第二个分配的端口。隧道则不需要。
🔔 Discord Webhook 设置
- 进入你的 Discord 频道 → 编辑频道 → 集成 → Webhooks → 新建 Webhook
- 复制 Webhook URL
- 将其粘贴到
config.yml 中的 discord.webhook.url 下
- 设置
discord.webhook.enabled: true
- 重启或运行
/nodebot reload
🐋 Pterodactyl 说明
NodeRunner 已在 Pterodactyl 上完全测试。请注意:
- 该插件使用
.tar.gz 进行 Node.js 解压,以避免大多数容器镜像中缺失的 xz 依赖
- 如果最新的 Node.js LTS 无法在你的镜像中运行,NodeRunner 会自动回退到前一个版本
- 通过
config.yml 中的 env: 设置你的机器人令牌和其他密钥——不要在机器人文件中硬编码它们
- 仪表板默认只能通过隧道访问;直接打开它需要
bind-address: "0.0.0.0" 和一个单独分配的端口
📊 兼容性
|
|
| Minecraft |
1.21.x – 26.3.x |
| Java |
25+(使用 Java 25 编译) |
| 操作系统 |
Linux, macOS, Windows |
| 架构 |
x64, ARM64 |
| 托管方式 |
自建, Pterodactyl, 任何 VPS |
⚠️ 需要 Java 25: JAR 使用 Java 25 编译并使用虚拟线程。你的服务器必须运行 Java 25 或更高版本。推荐使用并经过全面测试的设置是 Paper 1.21.x+ 配合 Java 25。
🔗 相关
TunnelMC — 通过 ngrok 隧道将任何服务器端口暴露给互联网。与 NodeRunner 完美配合,使 Web 仪表板公开可用,而无需额外的端口分配。
PyRunner — 此插件的 Python 等效项。在你的 Minecraft 服务器旁运行一个 Python Discord 机器人。
📄 许可证
保留所有权利 — 本插件及其源代码均为专有软件。未经作者明确书面许可,不得复制、重新分发、修改或反编译本软件。
由 Spider 开发
NodeRunner 🚀
Run your Node.js Discord bot directly inside your Minecraft server — no VPS, no extra hosting, no SSH.
NodeRunner is a Paper plugin that manages a Node.js process as a child of your Minecraft server. It handles everything automatically: downloading Node.js, installing dependencies, restarting on crash, live log streaming via a web dashboard, and Discord notifications — all from one config.yml.
🆕 What's New in 1.5.2: Platform Fixes
Fixes
- Fixed: 32-bit ARM Linux (such as older Raspberry Pi OS) downloaded the x64 build of Node.js, which can't run there. It now gets the ARM build. The newest Node.js with one is 22, so that's what it installs.
- Fixed:
npm install on Windows failed when the server's folder path contained (, ), & or %, such as one under Program Files (x86). npm now runs through Node.js directly instead of cmd.exe.
Also included from 1.5.1: Reliability & Security Fixes
If you downloaded 1.5.0 from spidey.in, please update: its dashboard didn't work after login. The 1.5.0 on Modrinth has the same code as 1.5.1, only the version number differs.
Security
- New installs get a random dashboard password, printed once in the console, and listen on
127.0.0.1 only. Before, every install used changeme on all network interfaces. Existing installs keep their settings, so if yours is still changeme, change it now.
- Fixed: the login lockout could be bypassed by sending many guesses at once, and one stranger's bad guesses behind a tunnel could lock you out.
- Fixed: oversized login requests could use up server memory.
- Fixed:
/nodebot logs treated bot output as formatted chat, so a message your bot logged could become a clickable command. Log lines are now plain text.
- Fixed: a bot's entry file or name could point outside the plugin's own folder.
Bots
- Fixed: one bot could end up running twice after Start during an install, or Stop and then Start, and Stop couldn't reach the second copy.
- Fixed: running
npm install by hand left the bot stuck on INSTALLING.
- Fixed: a mistyped bot name acted on your first bot.
- Fixed: renaming a bot to an existing name left the old one running with nothing tracking it, and editing a running bot could start the new one before the old one had stopped.
- Fixed: restarting could silently do nothing if triggered twice in quick succession.
- Node.js that can't run on your server is now detected. Node 26, the current LTS, needs
libatomic, which many Minecraft Docker images lack. NodeRunner test-runs each download, falls back to the previous LTS, and repairs an install that is already broken. Changing node-version takes effect without deleting anything.
- Fixed: a corrupted download archive could extract files outside its folder on Windows.
- Commands no longer use Paper-only classes, which Spigot and Bukkit don't have.
Dashboard
- Fixed: editing a bot could lose its environment variables, including bot tokens.
- Fixed: the live console could go blank under heavy bot output, and never updated behind a cloudflared quick tunnel.
- Fixed: the Settings page never showed your actual saved settings.
- Fixed: bot names containing an apostrophe broke every button on that bot's card.
- When your session ends, the dashboard returns to the login page.
✨ Features
⚡ Zero-Touch Node.js Setup
No Node.js on your server? No problem. NodeRunner auto-detects your OS and CPU architecture and downloads the newest Node.js LTS that runs on your server on first launch. Each download is test-run, with a fallback to the previous LTS when something like libatomic is missing. Works on Linux (x64, ARM64 & 32-bit ARM), macOS, and Windows, and is cached after that.
📦 Automatic Dependency Installation
Got a package.json? NodeRunner runs npm install automatically before launch whenever node_modules is missing. No manual intervention needed.
🔁 Crash Recovery & Loop Protection
Your bot is monitored constantly. On crash, NodeRunner waits a configurable delay and restarts it. If it crashes too many times within a short window, crash-loop protection halts retries and alerts you — no infinite restart spam.
🖥️ Live Web Dashboard
A built-in, password-protected control panel accessible from any browser:
- Live log streaming via Server-Sent Events (no page refresh)
- Start / Stop / Restart / npm install buttons
- Real-time status, uptime, PID, restart count, and memory usage
- stdin input bar — send commands directly to the bot process
- Multi-bot selector — switch between bots from the dashboard (auto-detected)
- Color-coded log output with auto-scroll toggle
- CSRF protection on all mutating endpoints
- Brute-force login protection — lockout after 5 failed attempts per visitor, even behind a tunnel
🔔 Discord Webhook Notifications
Get pinged in Discord when your bot starts, stops, crashes, or when npm install runs — via a standard webhook URL. No bot token required. Every event type is individually toggleable.
🎮 In-Game Commands
Full control from the Minecraft console or in-game via /nodebot. No SSH session needed just to restart your bot.
🤖 Multiple Bot Support
Run more than one Node.js bot simultaneously — each with its own process, log file, and independent crash recovery. Control each bot individually with /nodebot start <name>, /nodebot stop <name>, etc.
📌 Node.js Version Pinning
Pin a specific Node.js major version (e.g. "22") instead of the newest LTS that runs on your server. Useful if your bot requires a specific runtime version.
💻 stdin Passthrough
Send input directly to the bot process from the web dashboard without restarting it — useful for bots that accept console commands via stdin.
📊 Memory Monitoring
The web dashboard shows live memory usage (RSS) of the bot process, read directly from /proc/<pid>/status on Linux.
🔗 TunnelMC Integration
If TunnelMC is installed and has an active tunnel on the dashboard port, NodeRunner will print the public URL to console when the bot starts — purely informational, TunnelMC is never auto-started.
🐋 Pterodactyl Compatible
Fully tested on Pterodactyl panels. Uses .tar.gz for Node.js extraction (no xz dependency), and correctly injects the node binary into the process PATH for npm compatibility inside containers.
📥 Installation
- Drop
NodeRunner.jar into your plugins/ folder
- Start the server once to generate config files
- Place your bot code in
plugins/NodeRunner/bot/ (needs index.js + package.json)
- Set your bot token and any other secrets under
env: in config.yml
- Restart, or run
/nodebot start
NodeRunner handles the rest — Node.js download, npm install, and bot launch all happen automatically.
📂 File Structure
plugins/
NodeRunner/
config.yml ← All plugin settings
bot/ ← Your bot code goes here
index.js
package.json
logs/
bot.log ← Live output (rotates at 5MB, keeps 3 backups)
bot-<name>.log ← Per-bot log files when using multiple bots
nodejs/ ← Auto-downloaded Node.js binary (don't touch)
🎮 Commands & Permissions
Permission: noderunner.admin (default: OP)
| Command |
Description |
/nodebot start [name] |
Start the bot (or a specific bot by name) |
/nodebot stop [name] |
Stop the bot (or a specific bot by name) |
/nodebot restart [name] |
Restart the bot (or a specific bot by name) |
/nodebot status [name] |
Show status of all bots or a specific one |
/nodebot install [name] |
Force re-run npm install |
/nodebot reload |
Reload config.yml |
🌐 Web Dashboard
The dashboard listens on http://127.0.0.1:8080 (port is configurable), so by default only the server machine itself can open it. To reach it from elsewhere:
- use a tunnel such as TunnelMC or a Cloudflare Tunnel (no extra port needed), or
- set
dashboard.bind-address: "0.0.0.0" and open http://<your-server-ip>:8080
It is password protected. A random password is generated on first start, printed once in the console and saved in config.yml.
Pterodactyl users: 0.0.0.0 also needs a second allocated port. A tunnel doesn't.
🔔 Discord Webhook Setup
- Go to your Discord channel → Edit Channel → Integrations → Webhooks → New Webhook
- Copy the Webhook URL
- Paste it into
config.yml under discord.webhook.url
- Set
discord.webhook.enabled: true
- Restart or run
/nodebot reload
🐋 Pterodactyl Notes
NodeRunner is fully tested on Pterodactyl. Keep in mind:
- The plugin uses
.tar.gz for Node.js to avoid the xz dependency missing in most container images
- If the latest Node.js LTS can't run in your image, NodeRunner falls back to the previous one by itself
- Set your bot token and other secrets via
env: in config.yml — do not hardcode them in your bot files
- The dashboard is only reachable through a tunnel by default; opening it directly needs
bind-address: "0.0.0.0" and a separate allocated port
📊 Compatibility
|
|
| Minecraft |
1.21.x – 26.3.x |
| Java |
25+ (compiled with Java 25) |
| OS |
Linux, macOS, Windows |
| Architectures |
x64, ARM64 |
| Hosting |
Self-hosted, Pterodactyl, any VPS |
⚠️ Java 25 Required: The JAR is compiled with Java 25 and uses virtual threads. Your server must run Java 25 or higher. Paper 1.21.x+ with Java 25 is the recommended and fully tested setup.
🔗 Related
TunnelMC — Expose any server port to the internet via ngrok tunnels. Pairs perfectly with NodeRunner to make the web dashboard publicly accessible without needing an extra port allocation.
PyRunner — The Python equivalent of this plugin. Run a Python Discord bot alongside your Minecraft server.
📄 License
All Rights Reserved — This plugin and its source code are proprietary. You may not copy, redistribute, modify, or decompile this software without explicit written permission from the author.
Developed by Spider
评论 0
登录后参与评分
还没有评论,来抢沙发吧