Commands/publish
< Commands
This feature is exclusive to Java Edition.
publish
Permission level required |
4 |
---|---|
Restrictions |
No command blocks |
Opens singleplayer world to the local network.
Contents
Syntax[edit]
publish [<port>]
Arguments[edit]
<port>
: integer
- The port to host on. If not specified, a random port above 1024 is chosen.
- Must be a 32-bit integer number. And it must be between 0 and 65535 (inclusive).
Result[edit]
Command | Trigger | Java Edition |
---|---|---|
any | the arguments are not specified correctly | Unparseable |
the world is already published to LAN | Failed | |
the specified port could not be bound (e.g. a reserved port, or already in use by another application). | ||
On success | Open the world to the local network. |
Output[edit]
Command | Edition | Situation | Success Count | /execute store success ... | /execute store result ... |
---|---|---|---|---|---|
any | Java Edition | On fail | N/A | 0 | 0 |
On success | N/A | 1 | the port allocated for this LAN world. |
History[edit]
Java Edition | |||||
---|---|---|---|---|---|
1.3.1 | 12w24a | Added /publish . | |||
1.13 | 17w45a | /publish now accepts an optional port argument. |