1

Can you help us? We're trying to create a LAN game from the latest snapshot of Minecraft. While in-game on my single player map, I selected "Open to LAN" but instead of giving me the LAN IP or my laptop's name, it gave me "localhost:12345" where 12345 is a random port.

My brother is on Windows 7 while I'm on a OS X Snow Leopard. We tried creating the single-player LAN server over at his laptop as well but he instead got his computer name as opposed to my "localhost". With all that said, we still can't seem to connect to each other. When he tries to connect to me, he gets a "Failed to connect" error. If I try to connect over to him, I will get the "Connecting" message for quite some time then a few minutes later, my Minecraft would crash.

Can anyone help us out? I know this should be on the minecraft forums but it's currently loading very very slowly on our network for some reason.

2
  • I have exactly the same issue. "localhost" means that it binds server on local network interface that is accessible from the same machine only not from the network. I'm trying to figure out how to let Minecraft know the correct interface to bind to. Will post here if I will succeed.
    – lig
    Aug 2, 2012 at 6:38
  • ok. I'm done. Writing the answer now.
    – lig
    Aug 2, 2012 at 6:47

3 Answers 3

1

Open the console on your brother's computer and type in "ipconfig". This will return your brother's local IP address. Assuming you are on the same network, you will be able to connect to the server with that IP address. It should start with "192.168".

2
  • 1
    Or "10." depending on which private subnet is in use.
    – dlanod
    Jul 31, 2012 at 22:33
  • This is only possible with an actual server (doesn't have to be port forwarded for LAN use), not the "Open to LAN" option.
    – Timtech
    Jul 26, 2013 at 23:53
1

1. Open Terminal

2. Type

ifconfig

3. Write down your LAN ip

It is under eth0 (or ethN where N is any digit) section. Its the value after inet addr: in the second line of the section probably. It is something like 192.168.0.xx usually.

4. Type

sudo nano /etc/hosts

5. Edit the file.

You probably will see something like this (mine is from Ubuntu but it looks very similar on Mac OS)

127.0.0.1       myhostname localhost
::1             myhostname localhost ip6-localhost ip6-loopback
fe00::0         ip6-localnet
ff00::0         ip6-mcastprefix
ff02::1         ip6-allnodes
ff02::2         ip6-allrouters

The goal here to provide you LAN ip address to your hostname. Edit the file to look like

192.168.0.x     myhostname
127.0.0.1       localhost
::1             myhostname localhost ip6-localhost ip6-loopback
fe00::0         ip6-localnet
ff00::0         ip6-mcastprefix
ff02::1         ip6-allnodes
ff02::2         ip6-allrouters

Where 192.168.0.x is you LAN ip from the figure 3 above and myhostname is the hostname that was attached to 127.0.0.1 with localhost before editing.

6. Save the hosts file

Press Ctrl+o then Enter then Ctrl+x.

7. You are done

Start Minecraft and open your game to LAN. Minecraft shall display your LAN IP now instead of localhost.

-2

I don't understand why it would need a port. Whenever I play LAN games, I don't need to port forward or anything. Did you try:

  • brothers-computer-name with port number
  • brothers-computer-name without port number

The new snapshot is technically a beta, so maybe cross-platform support isn't in yet? I find this hard to believe, but it is possible (the crash is my support for this theory). Windows and OS X use their own networking libraries, I believe (I only know about Window's WinSock which I don't think would be on OS X), so the different addresses is probably not something Mojang can control.

Minecraft should automatically find the LAN server. Does it come up in the list? Or do you have to find it manually? I just did a quick test on my computer, and it came up and I could connect (aside from being kicked off for logging in with two clients). I have no ports forwarded or anything.

5
  • It doesn't come up anywhere, it's like the two units aren't on the same LAN network at all.
    – Propeller
    Jun 25, 2012 at 3:11
  • Typing in localhost and 127.0.0.1 on his brother's computer isn't going to work. Try pinging your computer from your brother's computer to see if his computer can see yours. Jun 25, 2012 at 20:27
  • Why was this answer downvoted?
    – Ender
    Jun 26, 2012 at 16:05
  • @Ender Because I forgot that you can't connect to another machine one your network with localhost (127.0.0.1). I'm a little rusty with LAN networking because my brother stopped playing computer games...
    – smoth190
    Jul 2, 2012 at 3:35
  • (edited to make it more accurate)
    – user28379
    Jul 18, 2012 at 20:20

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .