Commands/publish

From Minecraft Wiki
Jump to: navigation, search
Information icon.svg
This feature is exclusive to Java Edition.
publish
Restrictions

Operator
No command blocks

First introduced

Java Edition 1.3.1 (12w24a)

Opens singleplayer world to the local network.

Syntax[edit]

publish [<port>]

Arguments[edit]

<port>: integer

Must be a 32-bit integer number. And it must be between 0 and 65535 (inclusive).
The port to host on. If not specified, a random port above 1024 is chosen.

Result[edit]

CommandTriggerJava Edition
anythe arguments are not specified correctly Unparseable
if the world is already published to LAN Failed
if the specified port could not be bound (e.g. a reserved port, or already in use by another application).
On successOpen the world to the local network.

Output[edit]

CommandEditionSituationSuccess Count/execute store success .../execute store result ...
anyJava EditionOn failN/A00
On successN/A1the port allocated for this LAN world.

History[edit]

Java Edition
1.3.112w24aAdded /publish.
1.1317w45a/publish now accepts an optional port argument.