当你运行一个原版专用 Minecraft 服务器(例如 server.jar)时,它不会在本地网络上广播其存在。在 Minecraft 中,“对局域网可见”功能由客户端触发:当玩家将单人世界开放给局域网时,客户端会开始发送特殊的 UDP 广播数据包。同一网络上的其他客户端会接收到该数据包,并在多人游戏的局域网列表中显示该世界。
默认情况下,专用服务器仅监听传入的连接;它从不主动宣告自身存在。因此,即使你处于相同的本地网络中,像 HMCL、PCL2 或官方客户端这样的启动器也无法通过局域网扫描发现你的服务器。
此模组模拟了 Minecraft 客户端的行为。一旦服务器启动,它会定期发送与客户端将世界开放给局域网时完全相同的 UDP 广播数据包。该数据包包含服务器的 MOTD 和端口号。
当同一网络上的任何 Minecraft 客户端(或具有局域网扫描功能的启动器)接收到此数据包时,你的服务器会自动出现在局域网服务器列表中。玩家可以直接加入,而无需手动输入 IP 地址。
因此,它还可以允许如 Terracotta 等多人软件检测到你的服务器进程。
(开发过程中使用了 DeepSeek AI 辅助编码)
When you run a vanilla dedicated Minecraft server (e.g., server.jar), it does not broadcast its presence over the local network. In Minecraft, the “Open to LAN” feature is triggered by the client: when a player opens their single‑player world to LAN, the client starts sending a special UDP broadcast packet. Other clients on the same network see this packet and display the world in their multiplayer LAN list.
A dedicated server, by default, only listens for incoming connections; it never announces itself. As a result, even if you are on the same local network, launchers like HMCL, PCL2, or the official client cannot discover your server via the LAN scan.
This mod mimics the behaviour of a Minecraft client. Once the server has started, it periodically sends the exact same UDP broadcast packet that a client would send when opening a world to LAN. The packet contains the server’s MOTD and port number.
When any Minecraft client (or launcher with LAN scanning) on the same network receives this packet, your server automatically appears in the LAN server list. Players can join directly without manually typing an IP address.
So it can also allow multiplayer software like terracotta to detect your server processes
(开发过程中使用了 DeepSeek AI 辅助编码)
评论 0
登录后参与评分
还没有评论,来抢沙发吧