Opens a single-player world to the local network (LAN), allowing other players on the same network to join.
/publish [<allowCommands>] [<gamemode>] [<port>]
| Name | Required | Description |
|---|---|---|
| allowCommands | No | Whether to allow cheats/commands for other players joining (true or false). |
| gamemode | No | The default game mode for joining players (survival, creative, adventure, spectator). |
| port | No | The port to host on. A random available port is chosen if omitted. |
/publish /publish true creative /publish false survival 25565
This command is not usable from command blocks. It is a singleplayer-only command.