Skip to main content

/defaultgamemode

Sets the default game mode for new players joining the server. Players already online only switch when force-gamemode is on or the world is open to LAN.

Category
Gameplay
Permission Level
Game Master
Version Added
1.3.1

Overview

Sets the default game mode for new players joining the server. Players already online only switch when force-gamemode is on or the world is open to LAN. In vanilla Minecraft Java Edition it is one of the gameplay commands, first added in 1.3.1.

It is invoked as /defaultgamemode <mode> and accepts one required argument (<mode>).

New players get this mode the first time they join. If force-gamemode is true in server.properties, or the world is open to LAN, every online player is switched to it right away and the command returns how many players changed. Otherwise existing players keep their mode, and /gamemode with @a changes everyone who is online.

With force-gamemode=true in server.properties, or in a world opened to LAN, it also switches every player who is online at that moment. The command's result is the number of players it changed.

Syntax & Arguments

/defaultgamemode <mode>

The full syntax is /defaultgamemode <mode>. Angle brackets < > mark required arguments and square brackets [ ] mark optional ones; a vertical bar | between words means you pick exactly one of those literals. You must always supply <mode>.

mode
Required, of type a gamemode. The default game mode: survival, creative, adventure, or spectator.

Parameters

NameTypeRequiredDescription
modegamemodeRequiredThe default game mode: survival, creative, adventure, or spectator.

Examples

The 2 examples below are ready to copy and adapt. For instance, /defaultgamemode adventure sets the default game mode to adventure for all new players. Each example varies the arguments to show a different real use of /defaultgamemode; read the note under every snippet to see exactly what changes.

/defaultgamemode adventure

Sets the default game mode to adventure for all new players.

/defaultgamemode survival

Sets the default game mode back to survival.

Permission Level & Requirements

/defaultgamemode sits at permission Level 2 - Game Master / Cheats, which means it needs permission level 2, the level cheats grant to single-player worlds and that operators hold by default.

In a single-player world you must have "Allow Cheats" turned on (or open the world to LAN with cheats) before it will run; on a multiplayer server the player needs to be an operator at the matching level.

This reference describes the Java Edition 1.21 form of the command; Bedrock Edition may use slightly different argument formats.

Common Mistakes

Notes

New players get this mode the first time they join. If force-gamemode is true in server.properties, or the world is open to LAN, every online player is switched to it right away and the command returns how many players changed. Otherwise existing players keep their mode, and /gamemode with @a changes everyone who is online.

Related Commands

If /defaultgamemode is part of your toolkit, the commands below are the ones you will most often reach for alongside it: /gamemode and /difficulty. They cover closely related tasks, so the links above jump straight to each one.

Frequently Asked Questions about /defaultgamemode

What does the /defaultgamemode command do in Minecraft?

Sets the default game mode for new players joining the server. Players already online only switch when force-gamemode is on or the world is open to LAN. It belongs to the gameplay command group and was first added in Java Edition 1.3.1.

What is the correct syntax for /defaultgamemode?

/defaultgamemode <mode>. The required argument is mode.

What permission level does /defaultgamemode need?

It requires permission Level 2 - Game Master / Cheats. On a server the player must be an operator at that level, or have cheats enabled in single-player.

What is a common mistake when using /defaultgamemode?

Expecting it to switch players who are already online. That only happens with force-gamemode=true in server.properties or in a LAN world; otherwise only new players get the mode.

Can you give an example of /defaultgamemode in use?

Yes. /defaultgamemode survival: sets the default game mode back to survival.

Need a Minecraft server?

Try these commands on Astroworld or host your own server.

Try Astroworld Hosting