Skip to main content

Open to LAN worlds

You can play in your Singleplayer world with up to 8 friends in LAN, thanks to the fact that since Release 1.3.1 the game has an integrated server* in the client.

* - If you're going to play on a version prior to the mentioned one, you'll have to create a dedicated server.

Hosting

  1. You want to be the host, so you start the game, fire up the world of choice, press ESC and click Open to LAN.
  2. Now configure the server settings to your liking, and then click Start LAN World.
  3. Done, you should see a message like this in the chat: Local game hosted on port [50000] (the port may be different).
    • Depending on the version it can show you the IP and Port (for example: 192.168.1.100:50000).
  4. Tell your friends to join.

Joining

  1. The host already did everything and you want to connect, so you start the game and go to Multiplayer.
  2. You will see a caption that says Scanning for games on your local network, below it the host world should appear.
    • Every 1.5 seconds it refreshes, so don't spam the Refresh button.
  3. Done, select the server and click Join Server (or just double click).
    • The Direct Connection or Add Server option might work only if you and the host are Microsoft accounts, otherwise you will get this error.

Common issues

There are many possible problems and some are detailed in this external link.
Assuming the best case scenario where you know about IP, Firewall, etc. and therefore you've everything properly configured, there are 2 very common and "difficult" problems.

Failed to login: Invalid session

That's already answered here, but you don't have access to the server.properties file in this case!
There are two possible solutions, the 1st one would work in any case.

Vanilla (no mods)

Players will only be able to connect if it appears in Multiplayer under Scanning for games on your local network.
If the world isn't listed there (since connecting by IP:Port will give the invalid session error), you'll have to do this.

Modding

There are some mods that only add the option to change the Online Mode and this is what you're looking for.
In case you have never installed mods before, you can learn how to do that in the Modding guide.

Some mods that allow you to change Online Mode are the following:

Obviously install just one, not all of them! And you may prefer to search for another one because they may not be for the version and/or Mod Loader you want to use.

The world is not listed in the LAN list

There are some cases where everyone has everything properly configured (properly in LAN, Firewall allowed, etc.) but to some (or none) the world appears in LAN.
In my case it was always solved by modifying the network metric (this is explained in Windows, I'm not sure how it will be with Linux / macOS).

  1. Everyone must close the game and the launcher, but have Hamachi on (assuming you use Hamachi or another to have a virtual LAN).
  2. Run Windows PowerShell as administrator and type this command: Get-NetIPInterface
You will see something like this
ifIndex InterfaceAlias                  AddressFamily NlMtu(Bytes) InterfaceMetric Dhcp     ConnectionState PolicyStore
------- -------------- ------------- ------------ --------------- ---- --------------- -----------
5 Hamachi IPv6 1500 15 Enabled Connected ActiveStore
8 Ethernet IPv6 1500 25 Enabled Connected ActiveStore
1 Loopback Pseudo-Interface 1 IPv6 1500 75 Disabled Connected ActiveStore
5 Hamachi IPv4 1500 15 Enabled Connected ActiveStore
8 Ethernet IPv4 1500 25 Enabled Connected ActiveStore
1 Loopback Pseudo-Interface 1 IPv4 1500 75 Disabled Connected ActiveStore
  1. Now you must check the ifIndex and InterfaceMetric to modify them with this command:
    Set-NetIPInterface -InterfaceIndex XX -InterfaceMetric YY
    • Lower metric means higher priority (I use Hamachi 15, Ethernet 25 and Loopback 75).
    • Example command to make Hamachi 15: Set-NetIPInterface -InterfaceIndex 5 -InterfaceMetric 15
  2. Done, restart the PC and everything should be fine now.
    • Remember that everyone should do this.
note

If you look at the logs, you'll see that it tells you that there is an error about an invalid session! But it allows you to join anyway.

I also remind you that this assumes the best case scenario (everything is perfectly configured, just not using the correct network adapter) and that if it fails again just reboot the PC (at least, that was the solution to the few times it happened to me).