When playing Minecraft, it is possible to type commands into the chat box (opened by pressing “T” or “/”). These commands can trigger useful changes such as changing the time of day and weather or also provide utility such as teleporting around the map or giving items.
While in a multiplayer Minecraft game, these commands are helpful for Admins to do their job running the server. However, in a single-player game by yourself, these commands can be considered as “cheat codes” to make the game easier.
Most commands or cheat codes have some restrictions in Minecraft. On a multiplayer server, for most commands the player needs to be a server operator/admin (OP). In a single-player game, commands have to be turned on for your world (“Allow Commands” on Java, “Activate Cheats” on Bedrock). See the FAQ below for how to turn them on.
Note that server plugins and modpacks can add new commands to the game. This list will only cover the commands and cheats available in the base version of the game without any mods or plugins. Multiplayer servers will often have additional and different commands available.
Here is our list of the most popular and common Minecraft Commands and Cheat Codes, organized by category with copy and paste examples. The examples use Java Edition syntax, and the few commands that are typed differently on Bedrock are listed in their own table below. This list is current as of Minecraft Java 26.3 and Bedrock 26.50 (Wilderness Bound).
The 10 Most Useful Minecraft Cheats
If you just want the best cheats without reading the whole list, start with these:
| Cheat | What it does | Copy and paste example |
|---|---|---|
| /gamemode | Switch between survival and creative | /gamemode creative |
| /give | Give yourself any item | /give @s diamond 64 |
| /tp | Teleport anywhere instantly | /tp @s 0 100 0 |
| /gamerule keep_inventory | Keep your items when you die | /gamerule keep_inventory true |
| /time set | Skip to day or night | /time set day |
| /weather | Stop the rain | /weather clear |
| /locate | Find the nearest structure | /locate structure mansion |
| /effect | Give yourself potion effects | /effect give @s speed 300 2 |
| /enchant | Enchant the item in your hand | /enchant @s sharpness 5 |
| /summon | Spawn any mob | /summon creeper |

Java vs Bedrock: Commands That Are Typed Differently
Most commands on this page work the same on both editions. These are the ones that don’t, so use the Bedrock column if you play on console, mobile, or Windows Bedrock:
| What you want | Java Edition | Bedrock Edition |
|---|---|---|
| Keep inventory | /gamerule keep_inventory true | /gamerule keepinventory true |
| Stop the day/night cycle | /gamerule advance_time false | /gamerule dodaylightcycle false |
| Give a potion effect | /effect give @s speed 300 2 | /effect @s speed 300 2 |
| Clear potion effects | /effect clear @s | /effect @s clear |
| Add XP levels | /xp add @s 30 levels | /xp 30L @s |
Java renamed all of its game rules to lowercase names with underscores in version 1.21.11. If an older guide tells you to type keepInventory or doDaylightCycle on Java, use the new names above instead.
Target Selectors: @s, @p, @a, and @e
Many commands ask for a player name. Instead of typing a name, you can use these shortcuts, which are called target selectors:
| Selector | Who it targets |
|---|---|
| @s | Yourself (the player running the command) |
| @p | The nearest player |
| @a | All players |
| @e | All entities (mobs, items, players) |
| @r | One random player |
For example, /give @s diamond 64 gives the diamonds to you, while /give @a diamond 64 gives 64 diamonds to every player on the server.
General Minecraft Commands
The following commands can be used by any player in all Minecraft games (unless restricted by a multiplayer server owner):
| Command | What it does | Copy and paste example |
|---|---|---|
| /help or /? | Provides a list of common commands | /help |
| /list | Provides a list of players online | /list |
| /me | Sends an “emote” message into chat | /me waves hello |
| /msg | Sends a private message to the player specified. Alternatively, /tell and /w are the same as /msg | /msg Steve hello there |
| /seed | Displays the map seed. Works in single player on Java, but on a server you usually need to be an OP | /seed |
| /teammsg | Sends a private message to your team. Alternatively, /tm can also be used. Only available in Java Edition, and teams are created by OPs | /teammsg on my way |
Gamemode and Difficulty Cheats
These commands (and everything below) can only be used by OPs / Admins of a multiplayer server, or when commands are turned on in a single-player game.
| Command | What it does | Copy and paste example |
|---|---|---|
| /gamemode | Changes a player’s gamemode. Commonly used by admins to switch between survival and creative mode | /gamemode creative |
| /difficulty | Changes the game’s difficulty (easy, normal, hard, or peaceful) | /difficulty peaceful |
| /gamerule keep_inventory | Keeps your items and XP when you die. Probably the most popular cheat in the game! On Bedrock, type keepinventory instead | /gamerule keep_inventory true |
Item and Inventory Cheats
| Command | What it does | Copy and paste example |
|---|---|---|
| /give | Gives the specified item to the player in the amount specified | /give @s netherite_sword 1 |
| /clear | Deletes all items in your inventory | /clear |
| /enchant | Enchants a player’s gear. For example, /enchant Bob fortune 3 will enchant Bob’s tool with Fortune 3. It only works up to each enchantment’s normal max level, and only on items that can take that enchantment | /enchant @s fortune 3 |
| /xp | Adds to or sets a player’s experience by the amount specified. May also use /experience for same effect in Java Edition | /xp add @s 30 levels |
Teleport and Location Commands
| Command | What it does | Copy and paste example |
|---|---|---|
| /tp | Teleports one player (the target) to either another player or coordinate (the destination). For example, /tp Bob Joe will teleport the player “Bob” to “Joe” | /tp @s 0 70 0 |
| /locate structure | Displays coordinates for the nearest specified structure. For example, /locate structure mansion will display coordinates for the nearest Woodland Mansion | /locate structure village |
| /locate biome | Displays coordinates for the nearest specified biome. In older versions this was the separate /locatebiome command | /locate biome dappled_forest |
| /setworldspawn | Changes the world spawn to the player’s location. If executed in the console, coordinates would need to be provided | /setworldspawn |
| /spawnpoint | Changes an individual player’s respawn point to this location | /spawnpoint Steve |
World, Time, and Weather Cheats
| Command | What it does | Copy and paste example |
|---|---|---|
| /time set | Changes the time of the day. For example, /time set day will automatically set the time to morning | /time set day |
| /time add | Fast-forwards the time by adding to the time-value | /time add 1000 |
| /weather | Changes the weather. You can add a duration in seconds after the weather type. If you leave it out, the game picks a random length | /weather clear |
| /forceload | Forces a chunk to stay loaded. Only applicable to Java Edition | /forceload add ~ ~ |
| /worldborder | Toggles the world border, only useable in Java Edition | /worldborder set 1000 |
Mob and Entity Cheats
| Command | What it does | Copy and paste example |
|---|---|---|
| /summon | Spawns an entity, for example a creeper. A custom position can be specified but is not required | /summon creeper |
| /kill | Kills the specified player or entity | /kill Steve |
| /effect give | Modifies status effects on players. Specify the effect, how long it lasts in seconds, and the strength | /effect give @s speed 300 2 |
| /effect clear | Removes all status effects from a player | /effect clear @s |
New Commands in Wilderness Bound
The Wilderness Bound drop added two commands to Java Edition. Most players won’t need them, but map makers will:
| Command | What it does | Copy and paste example |
|---|---|---|
| /posteffect | Adds or removes screen effects (post-processing shaders from resource packs) on a player. Use add, remove, list, or clear | /posteffect clear @s |
| /compute | Works out a number for data packs and command setups. Mostly useful for map makers | /compute default integer 5 |
Multiplayer Server Management Commands
Note: The majority of these commands can be used in the server’s console without using the slash. For example, for a brand new server you can make yourself an OP by typing “op [name]” directly into the console, or you could save the map by typing “save-all”.
| Command | What it does | Copy and paste example |
|---|---|---|
| /kick | Kicks the player from the server. The player is free to rejoin at any time | /kick Steve |
| /ban | Bans a player from the server | /ban Steve |
| /ban-ip | Bans a player’s IP from the server | /ban-ip Steve |
| /banlist | Displays the players currently banned from the server | /banlist |
| /op | Assigns a player as a server operator (OP) | /op Steve |
| /deop | Revokes a player’s OP status | /deop Steve |
| /pardon | Unbans a player from the server | /pardon Steve |
| /pardon-ip | Unbans a player’s IP from the server | /pardon-ip 192.0.2.1 |
| /save-all | Saves the game world | /save-all |
| /stop | Turns off the server | /stop |
| /save-off and /save-on | Toggles whether the server should automatically save at intervals. If turned off, the server is only saved by the /save-all command | /save-off |
| /say | Announces a message to the entire server | /say Server restarting soon! |
| /team | Allows for creation of teams, which can chat with each other exclusively using /tm | /team add builders |
| /whitelist | Toggles whitelist functions. A whitelist is a list of players who are allowed to join the server and is useful for stopping griefers or random people from joining your server | /whitelist add Steve |
For the whitelist: it can be turned on or off with /whitelist on and /whitelist off. To view the full list, /whitelist list is used. Player names can be added or removed using /whitelist add [name] and /whitelist remove [name]. If the whitelist text file is modified, /whitelist reload will update the list from the file.
Frequently Asked Questions
How do you enable cheats in Minecraft?
On Java, turn on “Allow Commands” when you create the world. If you forgot, open the pause menu, go to World Options, and turn on “Allow Commands” there (Hardcore worlds don’t have this option). On Bedrock, turn on “Activate Cheats” in the world’s settings. On a server, an admin must make you an operator with the /op command.
Do cheats disable achievements?
On Bedrock, yes. Turning on cheats permanently stops that world from earning achievements, even if you turn cheats off again later. On Java, advancements still work with commands turned on. If you care about Bedrock achievements, make a separate world for playing with commands.
Why does Minecraft say my command is unknown or incorrect?
The three usual causes are commands being turned off in your world, using Java syntax on Bedrock (or the other way around), or typing an old game rule name on Java, like keepInventory instead of keep_inventory. Press Tab while typing a command and the game will suggest the right spelling for your version.
Can you turn cheats off again?
Yes. On Java, turn “Allow Commands” back off in World Options. On Bedrock, turn off “Activate Cheats” in the world settings, but the world still won’t earn achievements again.
That concludes our list of Minecraft commands and cheat codes! Did we miss a command you use all the time? Leave a comment below!




Fiery Gragon777
Sunday 23rd of February 2025
I want the cheats very much