/publish Command in Minecraft Java Edition

Publish Your World with the Publish Command

Java EditionServer AdminPermission: Level 4

The /publish command in Minecraft Java Edition lets a level 4 operator publish a world and decide if commands are allowed.

Players use this command to quickly set command permissions using a true or false value and optionally choose a specific port number between 0 and 65535.

Syntax (Java 26.3, 2 forms)

  1. /publish
  2. /publish <allowCommands> [<port>]

The forms you will use most

/publish
Publishes the world using the default settings without specifying arguments.
/publish <allowCommands> [<port>]
Publishes the world while setting whether commands are allowed and optionally choosing a custom port number.

Arguments

ArgumentTypeWhat it means
<allowCommands>true / falseA true or false value that decides whether commands are permitted.
<port>whole number
0 to 65535
An optional whole number from 0 to 65535 that sets the network port.

Examples

Version history

Measured from the game files of every Java release from 1.13 to 26.3.

  1. 26.3 Syntax changed.
    + /publish <allowCommands> [<port>]− /publish <allowCommands>− /publish <allowCommands> <gamemode> [<port>]
  2. 1.19.3 Syntax changed.
    + /publish+ /publish <allowCommands>+ /publish <allowCommands> <gamemode> [<port>]− /publish [<port>]
  3. 1.13 Already in the game in 1.13, the oldest Java version we track.

Tips

Common mistakes

Java vs Bedrock

Minecraft Bedrock Edition does not have a command named /publish, as this command is only available in Java Edition.

FAQ

Who can use the /publish command in Minecraft Java Edition?

You must have permission level 4 (Server owner) to run the /publish command.

What port numbers can I use with /publish?

The <port> argument accepts any whole number from 0 to 65535.

Did the /publish syntax change across versions?

Yes, before 1.19.3 the syntax was /publish [<port>], in 1.19.3 it added <allowCommands> and <gamemode>, and in 26.3 the gamemode argument was removed to leave /publish <allowCommands> [<port>].

Related commands

/ban/ban-ip/banlist/datapack/deop/fetchprofile/kick/list/op/pardon/pardon-ip/reload/save-all/save-off/save-on/setidletimeout