Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Minecraft:Commands/publish: Difference between revisions

From SAS Gaming Wiki
SyncBot (talk | contribs)
Fix template calls: add MC/ prefix
SyncBot (talk | contribs)
Sync: updated from Minecraft
Line 1: Line 1:
{{MC/Exclusive|java}}
{{exclusive|java}}
{{Infobox command
{{Infobox command
|name=publish
|name=publish
Line 6: Line 6:
}}
}}


Opens singleplayer world to the local network.
Opens [[Minecraft:singleplayer]] [[Minecraft:world]] to the local network.


==Syntax==
==Syntax==
:<code>publish [<allowCommands>] [<gamemode>] [<port>]</code>
:<code>publish [<allowCommands>] [<gamemode>] [<port>]</code>{{until|JE 26.2}}
:<code>publish [<online>] [<allowCommands>] [<gamemode>] [<port>]</code>{{upcoming|JE 26.2}}


==Arguments==
==Arguments==
{{argument|online|bool}}{{upcoming|JE 26.2}}
: Whether the world is published as an online world or as a LAN world. Defaults to true (online world).
: {{arg desc|je=bool}}


{{MC/Argument|allowCommands|bool}}
{{argument|allowCommands|bool}}
: Whether [[Minecraft:commands]] are allowed when the world is hosted on the local network. Defaults to false.
: Whether [[Minecraft:commands]] are allowed when the world is hosted on the local network. Defaults to false.
: {{arg_desc|je=bool}}
: {{arg_desc|je=bool}}


{{MC/Argument|gamemode|gamemode}}
{{argument|gamemode|gamemode}}
: Sets the default game mode for new player. If not specified, the default game mode for new player is the game mode of this world.
: Sets the default [[Minecraft:game mode]] for new player. If not specified, the default game mode for new player is the game mode of this world.
: {{arg_desc|je=gamemode}}
: {{arg_desc|je=gamemode}}


{{MC/Argument|port|integer}}
{{argument|port|integer}}
: The port to host on. If not specified, the port is automatically allocated, typically from an ephemeral port range.
: The [[Minecraft:wikipedia:port (computer networking)|port]] to host on. If not specified, the port is automatically allocated, typically from an ephemeral port range.
: {{MC/Arg desc|je=integer|min=0|max=65535}}
: {{arg desc|je=integer|min=0|max=65535}}


==Result==
==Result==
Line 34: Line 38:


== Output ==
== Output ==
{{MC/Output table}}
{{Output table}}
{{MC/Output table|edition=je|On fail|N/A|0|0}}
{{Output table|edition=je|On fail|N/A|0|0}}
{{MC/Output table|On success|N/A|1|the port allocated for this LAN world.}}
{{Output table|On success|N/A|1|the port allocated for this LAN world.}}
{{MC/Output table}}
{{Output table}}


== History ==
== History ==
{{HistoryTable
{{HistoryTable
|{{MC/HistoryLine|java}}
|{{HistoryLine|java}}
|{{HistoryLine||1.3.1|dev=12w24a|Added {{MC/Cmd|publish|link=none}}.}}
|{{HistoryLine||1.3.1|dev=12w24a|Added {{cmd|publish|link=none}}.}}
|{{HistoryLine||1.13|dev=17w45a|{{MC/Cmd|link=none|publish}} now accepts an optional {{MC/Cd|port}} argument.
|{{HistoryLine||1.13|dev=17w45a|{{cmd|link=none|publish}} now accepts an optional {{cd|port}} argument.
|{{MC/Cmd|link=none|publish}} can now be run from command blocks.}}
|{{cmd|link=none|publish}} can now be run from [[Minecraft:command block]]s.}}
|{{HistoryLine|||dev=18w01a|{{MC/Cmd|link=none|publish}} can no longer be run from command blocks.}}
|{{HistoryLine|||dev=18w01a|{{cmd|link=none|publish}} can no longer be run from command blocks.}}
|{{HistoryLine||1.19.3|dev=22w45a|The syntax of {{MC/Cmd|link=none|publish}} has been changed, and now accepts optional command and gamemode arguments.}}
|{{HistoryLine||1.19.3|dev=22w45a|The syntax of {{cmd|link=none|publish}} has been changed, and now accepts optional command and gamemode arguments.}}
|{{HistoryLine|java upcoming}}
|{{HistoryLine||26.2|dev=snap8|The syntax of {{cmd|link=none|publish}} has been changed again, and now accepts optional online argument.}}
}}
}}


== Navigation ==
== Navigation ==
{{MC/Navbox commands}}
{{Navbox commands}}


de:Befehl/publish
[[Minecraft:de:Befehl/publish]]
es:Comandos/publish
[[Minecraft:es:Comandos/publish]]
ja:コマンド/publish
[[Minecraft:ja:コマンド/publish]]
lzh:令/publish
[[Minecraft:lzh:令/publish]]
pt:Comandos/publish
[[Minecraft:pt:Comandos/publish]]
ru:Команды консоли/publish
[[Minecraft:ru:Команды консоли/publish]]
zh:命令/publish
[[Minecraft:zh:命令/publish]]

Revision as of 11:06, 20 May 2026

Template:Exclusive Template:Infobox command

Opens Minecraft:singleplayer Minecraft:world to the local network.

Syntax

publish [<allowCommands>] [<gamemode>] [<port>]Template:Until
publish [<online>] [<allowCommands>] [<gamemode>] [<port>]Template:Upcoming

Arguments

Template:ArgumentTemplate:Upcoming

Whether the world is published as an online world or as a LAN world. Defaults to true (online world).
Template:Arg desc

Template:Argument

Whether Minecraft:commands are allowed when the world is hosted on the local network. Defaults to false.
Template:Arg desc

Template:Argument

Sets the default Minecraft:game mode for new player. If not specified, the default game mode for new player is the game mode of this world.
Template:Arg desc

Template:Argument

The port to host on. If not specified, the port is automatically allocated, typically from an ephemeral port range.
Template:Arg desc

Result

Template:Result table Template:Result table Template:Result table Template:Result table Template:Result table Template:Result table

Output

Template:Output table Template:Output table Template:Output table Template:Output table

History

Template:HistoryTable

Navigation

Template:Navbox commands

Minecraft:de:Befehl/publish Minecraft:es:Comandos/publish Minecraft:ja:コマンド/publish Minecraft:lzh:令/publish Minecraft:pt:Comandos/publish Minecraft:ru:Команды консоли/publish Minecraft:zh:命令/publish