Minecraft Commands

Complete reference for 31 Minecraft 1.21.8 commands. Click any command for full syntax, parameter descriptions, examples, and FAQs.

/banModeration
Ban a player by name.
/ban <targets> [<reason>]
Server admin (op level 3)
/clearItems
Remove items from a player's inventory.
/clear [<targets>] [<item>] [<count>]
Cheats (op level 2)
/cloneWorld
Copy a region of blocks to another location.
/clone <from1> <from2> <to>
Cheats (op level 2)
/datapackDatapack
Manage installed datapacks.
/datapack <enable|disable|list> [<name>]
Cheats (op level 2)
/deopModeration
Revoke operator status.
/deop <targets>
Server admin (op level 3)
/effectPlayers
Apply or remove status effects.
/effect give <targets> <effect> [<seconds>] [<amplifier>] [<hideParticles>]
Cheats (op level 2)
/enchantItems
Enchant the held item.
/enchant <targets> <enchantment> [<level>]
Cheats (op level 2)
/executeGameplay
Modify command context and run a chained command.
/execute <subcommand> [<subcommand>...] run <command>
Cheats (op level 2)
/fillWorld
Fill a region with a block.
/fill <from> <to> <block> [destroy|hollow|keep|outline|replace] [<replaceFilter>]
Cheats (op level 2)
/functionDatapack
Run a datapack function file.
/function <name>
Cheats (op level 2)
/gamemodePlayers
Change a player's game mode.
/gamemode <mode> [<targets>]
Cheats (op level 2)
/gameruleWorld
Read or change a game rule.
/gamerule <rule> [<value>]
Cheats (op level 2)
/giveItems
Give items to a player.
/give <targets> <item>[<components>] [<count>]
Cheats (op level 2)
/helpGameplay
alias: /?
List available commands.
/help [<command>]
All players
/kickModeration
Disconnect a player from the server.
/kick <targets> [<reason>]
Server admin (op level 3)
/killEntities
Kill entities (deal infinite damage).
/kill [<targets>]
Cheats (op level 2)
/listGameplay
List currently-online players.
/list [uuids]
All players
/locateWorld
Find the nearest structure or biome.
/locate <structure|biome|poi> <id>
Cheats (op level 2)
/msgPlayers
alias: /tell, /w
Send a private message to a player.
/msg <targets> <message>
All players
/opModeration
Grant operator status.
/op <targets>
Server admin (op level 3)
/sayPlayers
Broadcast a message as the executor.
/say <message>
Cheats (op level 2)
/scoreboardGameplay
Manage scoreboard objectives and player scores.
/scoreboard <objectives|players> <action> ...
Cheats (op level 2)
/setblockWorld
Place a single block.
/setblock <pos> <block> [destroy|keep|replace]
Cheats (op level 2)
/spawnpointPlayers
Set a player's personal spawn point.
/spawnpoint [<targets>] [<pos>]
Cheats (op level 2)
/summonEntities
Spawn an entity at a position.
/summon <entity> [<x> <y> <z>] [<nbt>]
Cheats (op level 2)
/teleportPlayers
alias: /tp
Teleport an entity to coordinates or another entity.
/teleport <targets> <x> <y> <z> [<yaw>] [<pitch>]
Cheats (op level 2)
/tellrawPlayers
Send formatted JSON text to players.
/tellraw <targets> <component>
Cheats (op level 2)
/timeWorld
Set or query the world time.
/time set <value|day|night|noon|midnight|sunrise|sunset>
Cheats (op level 2)
/titlePlayers
Show titles and subtitles on a player's screen.
/title <targets> <title|subtitle|actionbar|times|clear|reset> [<args>]
Cheats (op level 2)
/weatherWorld
Set the weather.
/weather <clear|rain|thunder> [<seconds>]
Cheats (op level 2)
/xpPlayers
alias: /experience
Give or query experience.
/xp add <targets> <amount> [points|levels]
Cheats (op level 2)

How to use commands in Minecraft

  1. Enable cheats. In single-player, "Allow Cheats" in world settings. On servers, you need operator (op) status — see /op.
  2. Open chat with T (or / to pre-fill the slash) and type the command.
  3. Use selectors like @p (nearest player), @a (all players), @e (every entity), @s (executor) to target who the command affects.
  4. Run from command blocks for in-world automation — place a command block (see command_block), open it, paste the command, and trigger it with redstone.

Quick-copy popular commands

/gamemode creative
/gamemode survival
/gamerule doDaylightCycle false
/time set day
/weather clear
/gamerule keepInventory true
/gamerule mobGriefing false
/kill @e[type=#minecraft:undead]
/kill @e[type=item]
/effect give @s instant_health 1 4
/give @p minecraft:diamond_block 64
/spawnpoint @p ~ ~ ~