A comprehensive reference for Minecraft Bedrock Edition (1.20.x) commands.
| Selector | Description |
|---|---|
@p |
Nearest player |
@r |
Random player |
@a |
All players |
@e |
All entities (mobs, items, etc.) |
@s |
The entity executing the command (Self) |
@c |
The player's agent (Education Edition/Code Builder) |
| Argument | Example | Description |
|---|---|---|
type |
@e[type=creeper] |
Selects entities of a specific type |
r / rm |
@a[r=10] |
Selects within a max radius (r) or min radius (rm) |
c |
@e[c=1] |
Limits the count of targets (nearest first) |
m |
@a[m=creative] |
Selects players by gamemode |
l / lm |
@a[lm=30] |
Selects by level max (l) or min (lm) |
name |
@e[name="Bob"] |
Selects entities with a specific name tag |
Teleport entities to locations or other entities.
# Teleport yourself to coordinates
/tp @s 100 64 -200
# Teleport yourself to another player
/tp @s "Player Name"
# Teleport relative to current position
/tp @s ~ ~10 ~
# Teleport with facing direction
/tp @s ~ ~ ~ facing @p
Changes the player's game mode.
# Survival Mode (0)
/gamemode s
# or
/gamemode survival
# Creative Mode (1)
/gamemode c
# or
/gamemode creative
# Adventure Mode (2)
/gamemode a
# or
/gamemode adventure
# Spectator Mode (Experimental/New)
/gamemode spectator
Gives items to players.
# Give a diamond sword
/give @s diamond_sword
# Give 64 stone
/give @s stone 64
# Give item with data value (Legacy/Some items)
# Syntax: /give <target> <item> [amount] [data] [components]
/give @s wool 1 14 (Red Wool)
# Give item with CanPlaceOn (Adventure mode)
/give @s stone 1 0 {"minecraft:can_place_on":{"blocks":["grass"]}}
Adds or levels up experience.
# Add 5 levels
/xp 5L @s
# Add 100 points
/xp 100 @s
Sets the world time.
# Set to day
/time set day
# Set to night
/time set night
# Set specific tick
/time set 0
Changes the weather.
# Clear weather
/weather clear
# Rain
/weather rain
# Thunderstorm
/weather thunder
Sets global world rules.
| Rule | Description |
|---|---|
keepinventory |
Keep items on death (true/false) |
dodaylightcycle |
Toggle sun movement (true/false) |
domobspawning |
Toggle mob spawning (true/false) |
mobgriefing |
Toggle mob destruction (true/false) |
doweathercycle |
Toggle weather changes (true/false) |
commandblockoutput |
Toggle command block chat (true/false) |
showcoordinates |
Show coordinates on screen (true/false) |
# Enable keep inventory
/gamerule keepinventory true
# Show coordinates
/gamerule showcoordinates true
Manages status effects.
# Give Speed II for 30 seconds
/effect @s speed 30 2
# Give Night Vision (hide particles)
/effect @s night_vision 10000 0 true
# Clear all effects
/effect @s clear
Fills a volume with blocks.
# Fill region with dirt
/fill ~ ~ ~ ~5 ~5 ~5 dirt
# Replace only air with water
/fill ~-5 ~-5 ~-5 ~5 ~5 ~5 water 0 replace air
# Fill using block states
/fill ~ ~ ~ ~10 ~1 ~10 stone ["stone_type"="granite"]
Changes a specific block.
# Place a redstone block
/setblock ~ ~-1 ~ redstone_block
# Destroy block and place air
/setblock 100 64 100 air 0 destroy
Enchants the held item.
# Add Sharpness V
/enchant @s sharpness 5
# Add Unbreaking III
/enchant @s unbreaking 3
Finds the nearest biome or structure.
# Find nearest village
/locate structure village
# Find nearest ancient city
/locate structure ancient_city
Removes entities.
# Kill yourself
/kill @s
# Kill specific entity type
/kill @e[type=zombie]
Keeps chunks loaded even when no players are nearby.
# Add a ticking area (radius 4 chunks)
/tickingarea add circle ~ ~ ~ 4 MyArea
# List all areas
/tickingarea list
# Remove an area
/tickingarea remove MyArea