← Back to Command Directory ← Back to Home

/publish

Opens a single-player world to the local network (LAN), allowing other players on the same network to join.

Syntax

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

Parameters

NameRequiredDescription
allowCommandsNoWhether to allow cheats/commands for other players joining (true or false).
gamemodeNoThe default game mode for joining players (survival, creative, adventure, spectator).
portNoThe port to host on. A random available port is chosen if omitted.

Examples

/publish
/publish true creative
/publish false survival 25565

Notes

Command Block Use

This command is not usable from command blocks. It is a singleplayer-only command.

Related Commands