Commands in Minecraft
Commands are text instructions that you type into chat or into a command block. They let you change world settings, manage players and carry out advanced operations. Commands are an essential tool for server admins, adventure map creators and players in Creative mode.
This page is a section hub: it explains how commands work and leads to the two lists people use most often:
- Complete list of Minecraft commands: a reference table with syntax, description and edition labels, plus a list of game rules and a printable cheat sheet.
- Minecraft cheats and commands: ready-to-copy commands for items, effects, game modes and quick tricks.
How to enter commands
To use a command in Minecraft, press T (chat) or / (opens chat with the slash already typed). Every command starts with the / character. In singleplayer, commands work automatically once you allow commands in the world (turn on cheats). On a server you need operator (OP) status or the right permissions granted by a plugin.
On servers running Bukkit, Spigot or Paper, you can configure permissions for individual commands with plugins such as LuckPerms. In Bedrock Edition on Realms, the owner can grant permissions through the world settings.
Differences between Java and Bedrock Edition
Command syntax differs between Java Edition and Bedrock Edition (Windows 10, Xbox, PlayStation, Switch, iOS, Android). Java Edition uses namespaced IDs (for example minecraft:diamond_sword), while Bedrock Edition often uses shorter names. Some commands exist in only one edition. For example, /execute works completely differently in the two editions. In the guides below we always mark the differences.
Target selectors
Many commands need a target: the player or entity the command should affect. These are the main selectors:
@p: the nearest player@a: all players@r: a random player@e: all entities (players, mobs, items on the ground)@s: the entity that runs the command (the player itself or a command block)
You can extend selectors with filters in square brackets. For example, @e[type=zombie,distance=..10] selects all zombies within 10 blocks.
Guides to the most important commands
Below you will find detailed guides to the most commonly used commands. Each one covers the full syntax for Java and Bedrock Edition, a description of the parameters, usage examples and practical tips. If you want everything in one table, check the complete command list.
| Command | Description | Category |
|---|---|---|
| /gamemode | Changes the game mode (survival, creative, adventure, spectator) | Gameplay |
| /give | Gives items to players with full control over item data | Items |
| /teleport | Teleports players and entities to the given coordinates | Movement |
| /effect | Gives and removes status effects (buffs and debuffs) | Effects |
| /enchant | Applies enchantments to the held item | Enchantments |
| /fill | Fills rectangular areas with blocks | Building |
| /summon | Summons mobs and entities with NBT data | Entities |
| /worldborder | Manages the world border (size, center, warnings) | World |
| /kill | Instantly kills entities, mobs and players, with selector filters | Entities |
| /spawnpoint | Sets a player's spawn point at a chosen position | Player |
Other useful commands
Besides the commands above, Minecraft has dozens of others. These are the ones people use most often:
/time set day: sets the time of day to day/weather clear: turns off rain and thunderstorms/difficulty peaceful: changes the difficulty to Peaceful/kill @e[type=!player]: kills all entities except players/gamerule keep_inventory true: players keep their items after death (Java up to 1.21.10:keepInventory, Bedrock:keepinventory, more in the keep inventory guide)/locate structure village: shows the coordinates of the nearest village/setworldspawn: sets the world spawn point to your position/clear @s: removes all items from your inventory
We collected ready-made command sets to copy (items, effects, game rules) on the Minecraft cheats and commands page.
New and lesser-known commands
These commands were added in recent versions or rarely make it into guides. Each has its own page in the command catalog:
- /attribute: changes the attributes of players and mobs, with a full list of attributes (Java 1.16 and newer)
- /compute: calculates the values of number providers in data packs (Java 26.3)
- /posteffect: post-processing effects on players' screens, such as blur (Java 26.3)
- /swing: the hand swing animation without dealing a hit (Java 26.1)
- /fetchprofile: a player profile with skin, by name or UUID (Java 1.21.9)
- /publish and /unpublish: open and close a world to LAN from chat (/unpublish since Java 26.2)
- /fillbiome: changes the biome in a chosen area (Java 1.19.3)
- /party: a message to the party chat in Bedrock Edition (since 26.50)
Two older commands have changed as well: /time works on world clocks since Java 26.1 (pausing and the speed of time), and /gamerule has used snake_case rule names since Java 1.21.11.
Command block
A command block is a special block that runs commands automatically, without a player. You can get one with the command /give @s command_block. There are three types of command blocks:
- Impulse (orange): runs the command once when it receives a redstone signal
- Chain (green): runs the command when the block before it in the chain finishes its command
- Repeat (purple): runs the command every tick (20 times per second)
Command blocks are the basis for building adventure maps, minigames and advanced mechanisms on servers. Combined with the /fill command and /summon, they let you build complex mechanics without any mods or plugins.
Command permissions
In singleplayer, commands work if you turn on the Allow Commands option (Java) or Activate Cheats (Bedrock) when you create the world. If you forgot, on Java 26.3 and newer press Esc and turn on commands in World Options. On Java 26.2 you open the same World Options from the Options menu, and on Java 26.1 and older use Open to LAN with Allow Cheats turned on: commands then work until you close the world. You will find the details in the guide how to enable cheats in Minecraft.
On a Minecraft server, every operator (OP) has access to commands. An admin can grant OP status with the /op <player> command from the server console or through the ops.json file. On servers with plugins (Bukkit, Spigot, Paper) it pays off to use permission systems such as LuckPerms, which let you control exactly who has access to which commands.
In Bedrock Edition on Realms, the owner grants permissions through the world settings. On dedicated Bedrock servers, operators are added through the permissions.json file with the permission level "operator".
Functions and data packs
Advanced creators can combine commands into functions: text files with the .mcfunction extension that contain lists of commands that run together. Functions are placed in data packs and called with the /function <name> command. This lets you build complex mechanisms without using many command blocks: one file with hundreds of commands is enough.
Tips for beginners
- Use the Tab key to autocomplete commands and parameters: Minecraft suggests the available options
- The up arrow recalls the command you typed before, which is handy when repeating commands
- Coordinates with a tilde (
~) are relative:~0 ~5 ~0means 5 blocks above your position - Coordinates with a caret (
^) are relative to the direction you are looking:^0 ^0 ^5is 5 blocks in front of you - Type
/help <command>to see the syntax of a command in the game
Pick a command from the list above to read a detailed guide with syntax, parameters and usage examples. Looking for everything in one place? Open the complete command list or the cheat sheet with cheats and commands.