Minecraft LAN server works but cannot find it

minecraft-java-edition

a friend and I usually play Minecraft together on LAN worlds. Everything works perfectly if we direct connect by typing in the local IP address as well as the port. This is okay usually, since when you open a LAN world a message pops up that tells you the port. We tell each other the port and direct connect using the IP and port. The games do not show up in the multiplayer screen under Scanning for games on your local network

I have added Minecraft and JavaApplicationStub to allow incoming connections in my Mac firewall.

It is annoying to have to type in the IP and port every time we want to play. Also, we are trying a new mod and when we open the world to LAN, there is no message that tells the port. Is there a way I can get these games to appear when scanning for multiplayer games? We are both on Mac OS X.

Best Answer

So I've done some testing on my side on a Windows machine, and this should be the same on all systems from what I've seen online.

I've setup two machines, with Minecraft on both PCs. I've also installed TPCView on both machines to view the network connections they create and leave open. What I've found that is Minecraft does not use it's own PID when making a network connection, but instead has Java handle the network calls.

Screenshot of Java Network calls

From my personal PC, Java opens and connects with 6010-6127 onto a process locally. (Most likely this is to the Minecraft Process, except the red one which is Amazon's cloud services) When I click into the Multiplayer tab, we get four new connections, but two of them (UDP 4445) are left open:

Screenshot of Java Network calls while searching the network

I've tested this on the other PC, with the same outcome. four new connections, two of them matches the port that the game reports (60xx), and the other two are UDP 4445 left unconnected.

On searching about this, I've found a post from 2012 about a plugin author making an app to make local worlds announce themselves as LAN worlds using the same UDP 4445 "Announce" port. I would have to believe that this port (UDP 4445) is the one that is being blocked from allowing the game to announce it self as a "open server" locally.