![]() |
VOOZH | about |
/publish| Permission level required |
4 |
|---|---|
| Restrictions | No dedicated server |
{
"title": "<code>/publish</code>",
"rows": [
{
"field": "4",
"label": "(link to Permission level article, displayed as Permission level<br>required)"
},
{
"field": "No dedicated server<br>",
"label": "(link to Commands#Restrictions article, displayed as Restrictions)"
}
],
"invimages": [],
"images": []
}
Opens singleplayer world to the local network.
publish [<allowCommands>] [<gamemode>] [<port>]<allowCommands>: bool
true or false).<gamemode>: gamemode
survival for Survival modecreative for Creative modeadventure for Adventure modespectator for Spectator mode<port>: integer
| Command | Trigger | Java Edition |
|---|---|---|
| Any | The command is incomplete, or any argument is 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). | ||
| Otherwise | Successful |
| 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. |
| Java Edition | |||||||
|---|---|---|---|---|---|---|---|
| 1.3.1 | 12w24a | Added /publish. | |||||
| 1.13 | 17w45a | /publish now accepts an optional port argument.
| |||||
/publish can now be run from command blocks. | |||||||
| 18w01a | /publish can no longer be run from command blocks. | ||||||
| 1.19.3 | 22w45a | The syntax of /publish has been changed, and now accepts optional command and gamemode arguments. | |||||
| 26.2 | snap8 | The syntax of /publish has been changed again, and now accepts optional online argument. | |||||
| pre1 | The above change has been reverted. | ||||||