Minecraft:Commands/publish: Difference between revisions
More actions
imported>ElGrenier Merged the 2 "1.13" |
Fix template calls: add MC/ prefix |
||
| (One intermediate revision by the same user not shown) | |||
| Line 1: | Line 1: | ||
{{ | {{MC/Exclusive|java}} | ||
{{Infobox command | {{Infobox command | ||
|name=publish | |name=publish | ||
| Line 6: | Line 6: | ||
}} | }} | ||
Opens | Opens singleplayer world to the local network. | ||
==Syntax== | ==Syntax== | ||
| Line 13: | Line 13: | ||
==Arguments== | ==Arguments== | ||
{{ | {{MC/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}} | ||
: Sets the default | : 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. | ||
: {{arg_desc|je=gamemode}} | : {{arg_desc|je=gamemode}} | ||
{{ | {{MC/Argument|port|integer}} | ||
: The | : The 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}} | ||
==Result== | ==Result== | ||
| Line 34: | Line 34: | ||
== Output == | == Output == | ||
{{Output table}} | {{MC/Output table}} | ||
{{Output table|edition=je|On fail|N/A|0|0}} | {{MC/Output table|edition=je|On fail|N/A|0|0}} | ||
{{Output table|On success|N/A|1|the port allocated for this LAN world.}} | {{MC/Output table|On success|N/A|1|the port allocated for this LAN world.}} | ||
{{Output table}} | {{MC/Output table}} | ||
== History == | == History == | ||
{{HistoryTable | {{HistoryTable | ||
|{{HistoryLine|java}} | |{{MC/HistoryLine|java}} | ||
|{{HistoryLine||1.3.1|dev=12w24a|Added {{ | |{{HistoryLine||1.3.1|dev=12w24a|Added {{MC/Cmd|publish|link=none}}.}} | ||
|{{HistoryLine||1.13|dev=17w45a|{{ | |{{HistoryLine||1.13|dev=17w45a|{{MC/Cmd|link=none|publish}} now accepts an optional {{MC/Cd|port}} argument. | ||
|{{ | |{{MC/Cmd|link=none|publish}} can now be run from command blocks.}} | ||
|{{HistoryLine|||dev=18w01a|{{ | |{{HistoryLine|||dev=18w01a|{{MC/Cmd|link=none|publish}} can no longer be run from command blocks.}} | ||
|{{HistoryLine||1.19.3|dev=22w45a|The syntax of {{ | |{{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.}} | ||
}} | }} | ||
== Navigation == | == Navigation == | ||
{{Navbox commands}} | {{MC/Navbox commands}} | ||
de:Befehl/publish | |||
es:Comandos/publish | |||
ja:コマンド/publish | |||
lzh:令/publish | |||
pt:Comandos/publish | |||
ru:Команды консоли/publish | |||
zh:命令/publish | |||
Latest revision as of 20:12, 9 April 2026
Script error: No such module "Exclusive". Template:Infobox command
Opens singleplayer world to the local network.
Syntax
publish [<allowCommands>] [<gamemode>] [<port>]
Arguments
<allowCommands>: bool
- Whether Minecraft:commands are allowed when the world is hosted on the local network. Defaults to false.
- Template:Arg desc
<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.
- Template:Arg desc
<port>: integer
- The port to host on. If not specified, the port is automatically allocated, typically from an ephemeral port range.
- {{#vardefine:onlyje|}}{{#vardefine:onlybe| Template:IN,}}{{#vardefine:je-arg|integer}}{{#vardefine:be-arg|}}Template:Error{{#vardefine:onlyje|}}{{#vardefine:onlybe|}}{{#vardefine:je-arg|}}{{#vardefine:be-arg|}}
Result
Template:Result table Template:Result table Template:Result table Template:Result table Template:Result table Template:Result table
Output
{{#vardefine:output-table-lines|Expression error: Unrecognized punctuation character "{".}}{{#vardefine:output-table-lines|-2}}{{#vardefine:output-table-lines-now|}}{{#vardefine:command-num-now|}}{{#vardefine:command-line-now|}}{{#vardefine:commands-num|}}{{#vardefine:output-edition-num-now|}}{{#vardefine:output-edition-line-now|}}{{#vardefine:output-editions-num|}}{{#vardefine:je-outputs-dis|}}
{{#vardefine:output-table-lines|Expression error: Unrecognized punctuation character "{".}}{{#vardefine:situation-{{#var:output-table-lines}}|On fail}}{{#vardefine:output1-{{#var:output-table-lines}}|N/A}}{{#vardefine:output2-{{#var:output-table-lines}}|0}}{{#vardefine:output3-{{#var:output-table-lines}}|0}}{{#vardefine:command-row-{{#var:commands-num}}|Expression error: Unrecognized punctuation character "{".}}{{#vardefine:output-editions-num|Expression error: Unrecognized punctuation character "{".}}{{#vardefine:output-edition-{{#var:output-editions-num}}|je}}{{#vardefine:output-edition-row-{{#var:output-editions-num}}|1}} {{#vardefine:output-table-lines|Expression error: Unrecognized punctuation character "{".}}{{#vardefine:situation-{{#var:output-table-lines}}|On success}}{{#vardefine:output1-{{#var:output-table-lines}}|N/A}}{{#vardefine:output2-{{#var:output-table-lines}}|1}}{{#vardefine:output3-{{#var:output-table-lines}}|the port allocated for this LAN world.}}{{#vardefine:command-row-{{#var:commands-num}}|Expression error: Unrecognized punctuation character "{".}}{{#vardefine:output-edition-row-{{#var:output-editions-num}}|Expression error: Unrecognized punctuation character "{".}}
{{#vardefine:output-table-lines|Expression error: Unrecognized punctuation character "{".}}{{#vardefine:output-table-lines|-2}}{{#vardefine:output-table-lines-now|}}{{#vardefine:command-num-now|}}{{#vardefine:command-line-now|}}{{#vardefine:commands-num|}}{{#vardefine:output-edition-num-now|}}{{#vardefine:output-edition-line-now|}}{{#vardefine:output-editions-num|}}{{#vardefine:je-outputs-dis|}}
History
de:Befehl/publish es:Comandos/publish ja:コマンド/publish lzh:令/publish pt:Comandos/publish ru:Команды консоли/publish zh:命令/publish