Typing a /gamerule command in the Minecraft chat with autocomplete and command output visible

Minecraft commands are text instructions that let you bend the game to your will – change the time, spawn mobs, give yourself items, teleport, build instantly, and run whole servers. This is a comprehensive, categorized Minecraft commands list with the exact syntax and a copy-paste example for each, current as of June 2026.

It’s written for Java Edition (now on the year-based 26.x versioning Mojang introduced in 2026), with Bedrock differences flagged where they matter. Use your browser’s Find (Ctrl/Cmd + F) to jump to any command fast.

How to Use Minecraft Commands

Turn on cheats first. Commands only work if cheats are enabled. When creating a world, turn on Allow Commands (labeled “Allow Cheats” in older versions). In an existing single-player world, enable it for the session via Esc > Open to LAN > Allow Commands: ON > Start LAN World.

Minecraft Open to LAN screen with Allow Commands set to ON to enable cheats

Type in chat. Press T (or /) to open chat, then type the command starting with a forward slash, e.g. /time set day, and press Enter.

Command blocks run commands automatically via redstone. Get one with /give @p command_block (it can’t be crafted).

Minecraft command block interface showing the console command field with autocomplete suggestions

Target selectors save you typing player names:

  • @p – nearest player
  • @a – all players
  • @r – a random player
  • @e – all entities
  • @s – yourself (whoever runs the command)

You can filter them, e.g. @e[type=zombie,distance=..10] targets zombies within 10 blocks.

Coordinates: use exact numbers (100 64 -200), ~ for relative to you (~ ~5 ~ = 5 blocks up), or ^ for coordinates relative to where you’re facing.

Essential Commands (The Ones You’ll Use Most)

CommandWhat it doesExample
/help [command]Lists commands or shows help for one/help give
/gamemode <mode> [target]Changes game mode (survival, creative, adventure, spectator)/gamemode creative @s
/give <target> <item> [count]Gives items to a player/give @p diamond 64
/tp <target> <destination>Teleports a player or entity (alias of /teleport)/tp @s 100 70 -200
/time set <value>Sets the time (day, night, noon, midnight, or a number)/time set day
/weather <type> [duration]Sets weather (clear, rain, thunder)/weather clear
/difficulty <level>Sets difficulty (peaceful, easy, normal, hard)/difficulty hard
/kill [target]Kills a player or entity/kill @e[type=item]
/clear [target] [item]Clears items from inventory/clear @p
/seedShows your world’s seed/seed

Player & Inventory Commands

CommandWhat it doesExample
/give <target> <item> [count]Gives an item/give @p netherite_sword 1
/clear [target] [item] [maxCount]Removes items (all, or a specific item)/clear @a dirt
/xp add <target> <amount> [points|levels]Adds experience (alias /experience)/xp add @s 30 levels
/effect give <target> <effect> [secs] [amplifier]Applies a status effect/effect give @s speed 60 2
/effect clear [target] [effect]Removes status effects/effect clear @s
/enchant <target> <enchant> [level]Enchants the held item/enchant @p sharpness 5
/attribute <target> <attribute> ...Reads/modifies entity attributes/attribute @s minecraft:max_health get
/item replace ...Replaces an item in a slot/item replace entity @s weapon.mainhand with diamond
/recipe <give|take> <target> <recipe>Unlocks or removes recipes/recipe give @a *
/spawnpoint [target] [pos]Sets a player’s respawn point/spawnpoint @s ~ ~ ~

World & Environment Commands

CommandWhat it doesExample
/time set|add|query <value>Sets, adds, or checks time/time add 1000
/weather <type> [duration]Controls weather/weather thunder 600
/gamerule <rule> [value]Changes a game rule (see list below)/gamerule keep_inventory true
/setblock <pos> <block> [mode]Places a single block/setblock ~ ~ ~ stone
/fill <from> <to> <block> [mode]Fills a region with a block/fill ~ ~ ~ ~10 ~5 ~10 glass
/clone <from> <to> <dest> [mode]Copies a region of blocks/clone 0 64 0 10 70 10 50 64 50
/setworldspawn [pos]Sets the world spawn point/setworldspawn 0 64 0
/worldborder set <size> [time]Sets the world border size/worldborder set 1000
/forceload add <from> [to]Keeps chunks loaded/forceload add ~ ~
/locate structure <id>Finds the nearest structure/locate structure village
/locate biome <id>Finds the nearest biome/locate biome desert
/fillbiome <from> <to> <biome>Changes the biome in a region/fillbiome ~ ~ ~ ~16 ~ ~16 plains
/place structure|feature|jigsaw <id>Places a generated structure/feature/place feature minecraft:fossil

Entity & Mob Commands

CommandWhat it doesExample
/summon <entity> [pos] [nbt]Spawns an entity/summon lightning_bolt ~ ~ ~
/kill [target]Kills entities/kill @e[type=creeper]
/tp <target> <destination>Teleports entities/tp @e[type=pig] @s
/ride <target> mount|dismount <vehicle>Mounts/dismounts entities/ride @s mount @e[type=horse,limit=1]
/damage <target> <amount> [type]Deals damage to an entity/damage @e[type=zombie] 5
/data get|merge|modify ...Reads or edits entity/block NBT data/data get entity @s
/tag <target> add|remove|list [name]Adds custom tags to entities/tag @s add boss
/spreadplayers <x> <z> <spread> <max> ...Scatters players/entities randomly/spreadplayers 0 0 50 200 false @a

Multiplayer & Server Commands

CommandWhat it doesExample
/op <player>Grants operator (admin) status/op Notch
/deop <player>Removes operator status/deop Notch
/kick <player> [reason]Removes a player from the server/kick Steve AFK
/ban <player> [reason]Bans a player/ban Griefer
/pardon <player>Unbans a player/pardon Griefer
/whitelist <add|remove|on|off|list>Manages the server whitelist/whitelist add Alex
/listLists online players/list
/msg <targets> <message>Private message (aliases /tell, /w)/msg Alex on my way
/team <add|join|modify> ...Manages teams/team add red
/transfer <host> [port] [players]Sends players to another server/transfer play.example.com
/save-all / /stopSaves the world / stops the server/save-all
/defaultgamemode <mode>Sets the mode new players join in/defaultgamemode survival

Display & Technical Commands

CommandWhat it doesExample
/execute ...Runs commands conditionally / as other entities/execute as @a at @s run tp ~ ~10 ~
/scoreboard objectives|players ...Creates and manages scoreboards/scoreboard objectives add kills playerKill
/title <target> <title|subtitle|actionbar> <json>Shows on-screen text/title @a title {"text":"Game Over"}
/tellraw <target> <json>Sends formatted chat text/tellraw @a {"text":"Hello!","color":"gold"}
/bossbar add|set ...Creates a custom boss bar/bossbar add fight {"text":"Boss"}
/particle <name> [pos] ...Spawns particles/particle heart ~ ~1 ~
/playsound <sound> <source> <target>Plays a sound/playsound minecraft:entity.wither.spawn master @a
/function <id>Runs a datapack function/function mypack:start
/datapack <list|enable|disable>Manages datapacks/datapack list
/tick <query|rate|freeze|step|sprint>Controls the game’s tick rate/tick rate 10
/random <value|roll> ...Generates random numbers/random value 1..6
/spectate <target>Spectate an entity (spectator mode)/spectate @e[type=ender_dragon,limit=1]

New Commands in Minecraft 26.x

The 2026 updates added a few commands worth knowing (and renamed all game rules to snake_case — see the next section):

CommandWhat it does
/waypointManages waypoints shown on the new Locator Bar
/swing [hand]Makes a player/entity swing its arm
/fetchprofile entity <selector>Prints profile info for an entity
/publish [online] [mode] [port]Opens your world to LAN/online (now takes an online toggle)
/unpublishCloses a world you opened with /publish

Most Useful Game Rules

Type the full command in chat (cheats must be on). These are the current Java 26.x names (lowercase snake_case):

  • /gamerule keep_inventory true – keep your items when you die
  • /gamerule advance_time false – freeze the time of day
  • /gamerule advance_weather false – freeze the weather
  • /gamerule mob_griefing false – stop creepers/endermen from changing blocks
  • /gamerule spawn_monsters false – stop hostile mobs from spawning
  • /gamerule spawn_phantoms false – stop phantoms from spawning
  • /gamerule fire_spread_radius_around_player 0 – stop fire spreading near you
  • /gamerule random_tick_speed 3 – control how fast crops grow / fire spreads (default 3)
  • /gamerule show_death_messages false – hide death messages
  • /gamerule command_block_output false – stop command-block spam in chat
  • /gamerule players_sleeping_percentage 50 – % of players needed to sleep through night

Java vs Bedrock: Key Differences

Most commands work the same across both editions, but watch for these:

  • Game mode by number (Bedrock): Bedrock accepts /gamemode 0 (survival), 1 (creative), 2 (adventure), 3/spectator. Java uses the names.
  • No /enchant levels by name nuance: both have /enchant, but item IDs and some argument formats differ slightly.
  • Java-only: /datapack, /function, /attribute, /tick, /transfer, advanced /execute subcommands, and /tellraw JSON formatting are Java-focused (Bedrock has equivalents but different syntax).
  • Bedrock extras: Bedrock has unique commands like /camera, /inputpermission, /dialogue, and education-style commands not present in Java.
  • Coordinates and selectors (@p, @e, ~, ^) work in both editions.

When in doubt, the in-game auto-complete (it suggests valid arguments as you type) is the fastest way to confirm syntax for your exact version.

Frequently Asked Questions

How do I enable commands in Minecraft?

Turn on “Allow Commands” when creating a world, or open an existing single-player world to LAN with cheats enabled (Esc > Open to LAN > Allow Cheats: On). On a server, you need operator status via /op. Then type commands in chat starting with /.

What is the command to get anything in Minecraft?

/give. Use /give <player> <item> [count] – for example, /give @p diamond 64. In creative mode you can also pull items straight from the inventory menu.

How do I keep my items when I die?

Run /gamerule keep_inventory true. Set the value back to false to return to normal.

What’s the command to change the time to day?

/time set day. You can also use /time set night, /time set noon, or a number like /time set 6000.

Do these commands work on Bedrock Edition?

Most do, with small syntax differences – for example, Bedrock uses /gamemode 0 for survival, and some advanced Java commands (/datapack, /function) aren’t available. The essentials like /give, /tp, /time, /weather, and /effect work on both.

Will using commands disable achievements?

Yes – on Java and Bedrock, enabling cheats/commands in a world turns off advancement/achievement progress for that world. Use a separate world if you want to earn them legitimately.

Are these commands up to date?

Yes – this list is current as of June 2026 (Java Edition 26.x). Core commands rarely change between updates; the in-game auto-complete always reflects your exact version.


Commands turn Minecraft from a survival game into a sandbox you fully control – whether you’re setting up a server, building with /fill and /clone, or just flipping on keep_inventory for a relaxed run. Bookmark this page, use Ctrl + F to find what you need, and start with the essentials table above.

For more, explore our best Minecraft mods and the full Minecraft guides hub.

Leave a Comment

0 Comments
Oldest
Newest Most Voted