UPnP
一款轻量级的 Minecraft 插件,通过 UPnP(通用即插即用)自动打开服务器端口,无需在兼容的路由器上手动配置端口转发。
功能
- 自动端口映射:在插件启动时自动开启你的 Minecraft 服务器端口
- 自定义端口支持:为 Dynmap、Geyser 或语音聊天等插件配置额外端口
- 协议灵活性:支持 TCP 和 UDP 端口映射
- 自动清理:可选择在服务端关闭时释放端口
- 零配置:开箱即用,拥有合理的默认设置
- 轻量级:对服务器性能影响极小
工作原理
该插件使用 UPnP 协议 与你的路由器通信,并自动创建端口转发规则。这意味着玩家可以直接连接到你的服务器,而无需你手动配置路由器。
安装
- 从 Releases 下载最新版本
- 将 JAR 文件放入服务器的
plugins文件夹中 - 重启服务器
- 插件将自动打开你的服务器端口
配置
首次运行后,编辑 plugins/UPnP/config.yml:
# 是否在服务器停止时关闭端口(推荐:true)
close-ports-on-stop: true
# 通过 bStats 启用匿名使用统计
bstats: true
# 要开放的 TCP 端口(默认包含服务器端口)
tcp:
- 25565 # Minecraft 服务器
- 8123 # Dynmap(示例)
# 要开放的 UDP 端口
udp:
- 19132 # Geyser/Bedrock(示例)
常见端口示例
- Minecraft Java: 25565 (TCP)
- Dynmap: 8123 (TCP)
- Geyser/Bedrock: 19132 (UDP)
- BlueMap: 8100 (TCP)
- Simple Voice Chat: 24454 (UDP)
要求
- Minecraft 1.20 或更高版本(可能兼容旧版本)
- 支持 UPnP 的路由器
- 路由器已启用 UPnP(通常默认已启用)
故障排除
端口无法打开
- 检查路由器是否启用了 UPnP(请参阅路由器手册)
- 验证这些端口未被其他应用程序占用
- 查看服务器日志以获取错误信息
- 出于安全原因,某些 ISP 或路由器会阻止 UPnP
安全注意事项
虽然 UPnP 很方便,但它确实会在你的网络上开放端口。只开放你实际需要的端口,并且如果你不经常使用该插件,请考虑在路由器上禁用 UPnP。
统计
本插件使用 bStats 收集匿名使用统计数据。你可以在配置文件或全局的 plugins/bStats/config.yml 中禁用此功能。在 bStats 查看统计数据。
许可证
本模组遵循 GNU Lesser General Public License v3.0 only (LGPL-3.0-only) 许可。
这对用户和开发者的含义
- 你可以在整合包中使用本模组(包括商业整合包)。
- 你可以在服务器上运行本模组,包括付费或托管服务器。
- 其他模组可以在任何许可下依赖或集成此模组。
- 闭源模组和启动器可以链接到此模组。
你必须做的事情
- 如果你修改了本模组的源代码,必须以相同的 LGPL-3.0-only 许可证发布这些修改。
- 你必须允许用户独立替换或更新此模组(例如,作为普通 JAR 分发)。
你不需要做的事情
- 你不需要开源你的整个模组、服务器或整合包。
- 仅仅因为玩家连接,你不需要发布服务器源代码。
- 如果你只是依赖此模组,你不需要将项目授权给 LGPL。
许可证历史
2026年1月3日之前发布的版本遵循 AGPL-3.0-only 许可。你可以在此处阅读更多关于变更的信息 here。
2026年1月3日及之后发布的版本遵循 LGPL-3.0-only 许可。
完整许可证文本,请参阅 LICENSE 文件。
鸣谢
基于 weupnp 库构建。
注意:本插件按原样提供。始终确保你了解在网络中开放端口的安全风险。
UPnP
A lightweight Minecraft plugin that automatically opens server ports through UPnP (Universal Plug and Play), eliminating the need for manual port forwarding configuration on compatible routers.
Features
- Automatic Port Mapping: Opens your Minecraft server port automatically on plugin startup
- Custom Port Support: Configure additional ports for plugins like Dynmap, Geyser, or voice chat
- Protocol Flexibility: Supports both TCP and UDP port mappings
- Automatic Cleanup: Optionally closes ports when the server shuts down
- Zero Configuration: Works out of the box with sensible defaults
- Lightweight: Minimal performance impact on your server
How It Works
This plugin uses the UPnP Protocol to communicate with your router and automatically create port forwarding rules. This means players can connect to your server without you manually configuring your router.
Installation
- Download the latest release from Releases
- Place the JAR file in your server's
pluginsfolder - Restart your server
- The plugin will automatically open your server port
Configuration
After the first run, edit plugins/UPnP/config.yml:
# Whether to close ports when the server stops (recommended: true)
close-ports-on-stop: true
# Enable anonymous usage statistics via bStats
bstats: true
# TCP ports to open (includes server port by default)
tcp:
- 25565 # Minecraft server
- 8123 # Dynmap (example)
# UDP ports to open
udp:
- 19132 # Geyser/Bedrock (example)
Common Port Examples
- Minecraft Java: 25565 (TCP)
- Dynmap: 8123 (TCP)
- Geyser/Bedrock: 19132 (UDP)
- BlueMap: 8100 (TCP)
- Simple Voice Chat: 24454 (UDP)
Requirements
- Minecraft 1.20 or higher (may work on older versions)
- A router that supports UPnP
- UPnP enabled on your router (usually enabled by default)
Troubleshooting
Ports aren't opening
- Check that UPnP is enabled on your router (consult your router's manual)
- Verify the ports aren't already in use by another application
- Check server logs for error messages
- Some ISPs or routers block UPnP for security reasons
Security Considerations
While UPnP is convenient, it does open ports on your network. Only open ports you actually need, and consider disabling UPnP on your router if you're not actively using this plugin.
Statistics
This plugin uses bStats to collect anonymous usage statistics. You can disable this in the config file or globally in plugins/bStats/config.yml. View statistics at bStats.
License
This mod is licensed under the GNU Lesser General Public License v3.0 only (LGPL-3.0-only).
What this means for users and developers
- You may use this mod in modpacks (including commercial modpacks).
- You may run this mod on servers, including paid or hosted servers.
- Other mods may depend on or integrate with this mod under any license.
- Closed-source mods and launchers may link against this mod.
What you must do
- If you modify this mod’s source code, you must release those modifications under the same LGPL-3.0-only license.
- You must allow users to replace or update this mod independently (e.g., by distributing it as a normal JAR).
What you do not have to do
- You do NOT have to open-source your entire mod, server, or modpack.
- You do NOT have to publish server source code just because players connect.
- You do NOT have to license your project under LGPL if you merely depend on this mod.
License history
Versions released prior to January 3rd 2026 were licensed under AGPL-3.0-only. You can read more about the change here.
Versions released on or after January 3rd 2026 are licensed under LGPL-3.0-only.
For the full license text, see the LICENSE file.
Credits
Built using the weupnp library.
Note: This plugin is provided as-is. Always ensure you understand the security implications of opening ports on your network.
下载 UPnP
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 UPnP
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 UPnP
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 UPnP
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 UPnP
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 UPnP
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 UPnP
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 UPnP
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 UPnP
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 UPnP
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
许可通知与过渡声明
本项目此前仅采用 GNU 通用公共许可证第 3.0 版(AGPL-3.0-only)授权。
自 2026 年 1 月 3 日起,本项目已重新采用 GNU 宽通用公共许可证第 3.0 版(LGPL-3.0-only)授权。
这意味着:
- 项目本身仍为自由开源软件。
- 对本项目的修改仍需以 LGPL-3.0-only 协议发布。
- 其他项目(包括专有或闭源项目)可以链接、依赖或与此项目进行互操作,而无需采用 LGPL 协议,前提是不修改本项目的源代码。
- AGPL 的网络使用条款不再适用。
此次变更旨在提高与 Minecraft 模组生态系统的兼容性,包括整合包、服务器和第三方集成。
2026 年 1 月 3 日之前发布的所有版本仍受 AGPL-3.0-only 协议保护。 2026 年 1 月 3 日及之后发布的所有版本均受 LGPL-3.0-only 协议保护。
关于这个资源的讨论、问题反馈与使用心得
还没有讨论,来发第一帖吧
你是这个资源的作者?登录后可认领此资源。
相似资源
插件
PacketEvents 是一款专为 Minecraft Java 版打造的协议库,旨在简化数据包的处理与传输。
插件
ExyliaPlugins 的库。
插件
通过对话框或铁砧界面帮助你的 Anthme
插件
重新定义服务器上的生物运输方式。使用高度可定制的口袋道具,安全地捕获、存储和释放任何实体。
插件
为基于 Spigot/Paper/Folia 的服务器添加对 Vivecraft 的支持
插件
用于绘制游戏内地图或在浏览器中随探索实时进行地图绘制的实时地图。
评论 0
登录后参与评分
还没有评论,来抢沙发吧