Skip to main content
Minecraft Commands List: Cheats for Java and Bedrock

Minecraft Commands List: Cheats for Java and Bedrock

Turn on cheats for your world, open chat, and type a forward slash to run game mode, time, teleport and item commands.

Mostafa Salem
Written by
Mostafa Salem
Updated
Reading time
2 min
Difficulty
Beginner
How to Use Commands in Minecraft

See more GAMES.GG stories on Google

Advertisement

Turn on cheats for your world, open chat, and type a forward slash to run game mode, time, teleport and item commands. Below are the most useful commands, plus the syntax differences to watch for in Java and Bedrock.

How to Use Commands in Minecraft

Minecraft commands are typed into chat, start with a forward slash, and only work in a world with cheats turned on. In Minecraft, you can switch cheats on when you create a world or later in the world's settings, on both Java and Bedrock.

Turn On Cheats and Open Chat

  1. Turn on cheats for the world. On Bedrock, this permanently turns off achievements for that world, even if you switch cheats off again.
  2. Open chat. On PC, press T or the / key.
  3. Type the command. Press Tab to auto-complete command names and options, and the Up Arrow key to bring back the last command you ran.

On Bedrock, you also need the Operator Commands permission, which is on by default in worlds you create.

Most Useful Minecraft Commands

CommandWhat It Does
/gamemode creativeSwitches you to Creative. Also accepts survival, adventure or spectator.
/time set daySets the time. Also accepts night, noon, midnight or a number.
/weather clearClears the weather. Also accepts rain or thunder.
/tp 100 64 100Teleports you to those X, Y and Z coordinates.
/tp Steve AlexTeleports the player Steve to the player Alex.
/give @s diamond 64Gives you 64 diamonds. Swap in any item ID and amount.
/difficulty peacefulSets difficulty. Also accepts easy, normal or hard.
/locate structure <name>Shows the coordinates of the nearest structure, such as a village.
/locate biome <name>Shows the coordinates of the nearest biome.
/setworldspawnMakes your current spot the world spawn.
/helpLists every command, or explains one with /help <command>.

Java and Bedrock Differences

A few commands work differently between editions:

  • Game mode shortcuts: Bedrock also accepts c, s and a, or the numbers 1, 0 and 2. Java only takes the full names.
  • Time: Bedrock adds sunrise and sunset to the named times.
  • Effects: On Java, /effect give @s minecraft:night_vision infinite gives endless night vision. On Bedrock, it is /effect @s night_vision infinite.
  • Seed: Java has /seed to show your world seed. The seed guide explains what to do with it.

Building Commands

For building, /fill places one block across a whole area, and /clone copies a section of blocks to another spot. Both save time on the large projects in the build guide.

Keep Inventory and Other Game Rules

Game rules change how the world behaves. The one most players want is keep inventory, so you keep your items when you die.

Keep Inventory Commands

EditionCommand
Java/gamerule keep_inventory true
Bedrock/gamerule keepinventory true

Freeze Time and Weather

On Bedrock, /gamerule dodaylightcycle false freezes the time of day, and /gamerule doweathercycle false locks the current weather.

Java uses different rule names, so type /gamerule and press Tab to see the full list in your version.

Target Selectors

Swap a player name for a selector to target groups:

SelectorTargets
@pThe nearest player
@aAll players
@rA random player
@sYourself
@eAll entities, mobs included
@nThe nearest entity

Server and Realm Permissions

On a shared server or Realm, most of these commands need operator permission. The Realms guide covers setting up a Realm.

Advertisement