Tutorials/Setting up a LAN world

Java Edition
A LAN game is only accessible to other people in your local network (i.e. just the people also connected to your router/switch are able to connect to you) unless you setup port forwarding on your router, then people can directly connect with your IP and port. (ex. 123.45.67.89:43787)

To open your current single player world for other players in your LAN, type the command into the chat (note that this is still very restricted, e.g. you can't adjust the game options using the commandline) or access the Game Menu and click on the "Open to LAN" button. There you can select the gamemode for other players and whether they should be allowed to use Cheats. Both of these methods give you an IP for use, for example: "Local game hosted on hostname:12345". If you type and want to change the default gamemode, type  for example. Note: two computers using the same Minecraft account name cannot connect with this method.

Now other players can either connect to your game using the link Minecraft provided you or they can connect using the multiplayer menu with its new "Scanning for LAN-Worlds" section at the bottom.

On the technical side, a Minecraft client with an opened LAN game sends a UDP multicast to the local address 224.0.2.60:4445 every 1.5 seconds. Other clients then listen for this multicast to show your game in their multiplayer menu.

Bedrock Edition
On Bedrock Edition, LAN gameplay is on by default. The option to turn it on or off is in the multiplayer section op world settings, you cannot change this while in a world. You can change the number of slots by using /setmaxplayers (a cheat) up to 30. To change the game mode, change it in world settings.

教程/本地局域网联机