Skip to main content

/publish

Opens a singleplayer world to LAN, allowing other players on the local network to join.

Category
Special
Permission Level
Owner / Console
Version Added
1.3

Syntax

/publish [<allowCommands>] [<gamemode>] [<port>]

Parameters

NameTypeRequiredDescription
allowCommandsbooleanOptionalWhether to allow cheats for connecting players. Defaults to the current cheat setting.
gamemodegamemodeOptionalThe game mode for connecting players.
portintegerOptionalThe port to host on. Defaults to a random available port.

Examples

/publish

Opens the world to LAN with current settings on a random port.

/publish true survival 25565

Opens to LAN with cheats enabled, survival mode, on port 25565.

Common Mistakes

Notes

LAN worlds are temporary and only available while the host is online. The port is displayed in chat. Other players on the same network can see the world in their multiplayer list.

Related Commands

Need a Minecraft server?

Try these commands on Astroworld or host your own server.

Try Astroworld Hosting