How to play on lan with friends on minecraft [duplicate]

My LAN server won't let my cousin join me or me join my cousin. It won't show up on the multiplayer screen - it keeps saying "scanning for LAN servers" but it never finds it. I am at his house and we use different computers but it won't connect. How can I fix this?


Solution 1:

A few problems that can arise when attempting to connect a game. Note that these suggestions are made to minimize issues, I do not mean to imply you have to meet every condition here for it to work. Also I am assuming a LAN game, since non-LAN games introduce a whole host of other issues to resolve.

  • Lack of connectivity ensure everyone is connected to the home LAN (WiFi or cable), free WiFi or someone else's open WiFi can cause problems. If the server and players are not all connected to the same connection in the same way, cable vs WiFi, that can also be a problem.

  • Logins everyone needs to be logged into their own Minecraft account

  • Versions make sure everyone is running the same version, this includes the server software if you are using it

  • Mods if you are using mods, try it without them to make sure they aren't causing problems, easiest way is to move the folder where your mods are stored somewhere else, including the main jar file

  • Firewalls make sure that your firewall has an exception for the right version of Java, sometimes you can have a few versions installed, which can cause problems. Don't just allow the Minecraft.exe either, since it is just an updater. If your computer is connected to a network that you have told Windows is "public", there are rules in your Windows Firewall that Java set up that will disallow connections from public networks. Try disabling those rules.

  • Router rules can sometimes disallow connecting to other computers on the same network by default, as a security feature. There's no one way to fix this that works for every router, so you'll have to research your particular router and how to check/change its configuration.

  • IP addresses try to have a single IP address for each machine, this means don't connect to the wired and wireless at the same time, it can cause problems

  • Valid IP addresses If you are running Windows, you can get your IP address by running ipconfig, and if you're running OS X or Linux you can use ifconfig (f instead of p). Do this on both machines, and look for an address that starts with one of the following:

    • 192.168. (this is the most common)
    • 10. (this is not rare but not common)
    • 172. (this is rare!)

These are the beginnings of IPv4 addresses, so a complete address would look like, for instance 192.168.0.25, or 10.10.0.217. (If you're using IPv6 instead of IPv4, then you presumably already know what you're doing, and you don't need a guide like this to help you.)

Make sure that first three digits of the IP address match between the two computers. (This is a slight simplification but is what you want in 99% of cases. Google subnet masks if you want a more complete explanation).

To run ipconfig, you must open the command prompt (cmd) and type in ipconfig, then press enter. You can use the "Run..." command from the Start menu.

To run ifconfig in OS X, you can open Terminal.app from the Spotlight search. (Magnifying glass in the upper right, or command-space.)

If you're on Linux I'll assume you already know how to find your terminal emulator. (It varies too much from one distro to another to give a single set of directions. And if you don't know how to find it, then you're on the wrong OS for you.)

  • Try Direct Connect various problems can prevent automatic finding from working, try typing the address printed when the world was enabled into the Direct Connect link.

  • Try Re-installing Minecraft in cases where LAN abruptly stops working, reinstalling can help. Make sure to delete your .minecraft folder and clean with a tool like ccleaner. Be sure to clean registries as well, and backup just to be safe.

Hopefully this covers all of the most common issues.

Solution 2:

Try using direct connect.

  1. Open up command prompt (type in cmd in the start bar)
  2. type ipconfig and hit Enter.
  3. A list of your available network connections should appear. If you are using wireless to connect to your router (I assume you have one, since you are talking about LAN) then find the heading with "Wireless" in it. If you are connected to it using a wire, find the heading that begins with "Local Area Connection".
  4. Find the numbers after "IP Address." This should be similar to with "192.168.x.xxx", where the x's are other numbers.
  5. Hit the Direct Connect button at the bottom in Minecraft, and put the IP Address numbers (dots and all) from the console into the input box. Hit connect. To copy from the console, you'll need to right click in the console and select "Mark", select the numbers, then right click again and hit "copy."

This should work; if you get an error or can't follow (I'm doing this off the top of my head), leave a comment.

Solution 3:

Further to @Chaosed0 's answer, I had this problem until I noticed that the IP address given by the server wasn't in my private IP range (192.168.*) but was actually on a subnet associated with VMWare's virtual network adapters. As a quick fix I disabled them and the problem went away - I suppose the LAN server is binding to the first interface it comes across and doesn't care which, but I don't know how to select it (or if you can).

So far as answering the question, check that the IP address given on the server is on the same subnet as the client you're trying to connect from, though I don't know what to do if it's not...