MinecraftPublished on January 15, 202618 min read

+150 Minecraft Commands: Ultimate Java and Bedrock Guide

Minecraft commands let you switch game modes, teleport, give items or run a server. This guide lists 150 commands from Java Edition and Bedrock Edition, grouped by use, with their syntax and examples. It follows the current versions, Java 26.3 and Bedrock 26.60, and points out what has been renamed or removed.


How to use Minecraft commands

In game, press T or / to open the chat, then type the command. The Tab key completes command names and their arguments.

Requirements by edition

EditionRequirement
Java EditionIn single player, turn on Allow Commands when creating the world. On a server, be an operator.
Bedrock EditionTurn on Activate Cheats in the world settings and be an operator. On a dedicated server, set allow-cheats=true in server.properties.

In Java, the option has been called Allow Commands since 1.20.5 (it used to be Allow Cheats). An operator on a Java server can run commands even when it is off. In Bedrock, activating cheats disables achievements for that world.

From the OuiPanel console

On a Minecraft server hosted by OuiHeberg, the console in OuiPanel, the game panel, runs commands with full rights, without being logged into the game.

  1. In the side menu, open Console. The server must be running.

  2. Type the command in the "Type a command, without the leading slash" field, for example op Steve.

  3. Click Send or press Enter.

The server's reply appears in the console. The up and down arrows bring back the commands you already sent.

OuiPanel console with the op Steve command typed and the Send button

In the console, commands are typed without the slash: gamemode creative Steve, not /gamemode creative Steve. The @p and @s selectors target nobody from the console, so name the player.

How to read the tables

The Java and Bedrock columns show whether the command exists in each edition. The Access column says whether the command requires operator rights or works for every player. The guide How to manage players on your Minecraft server explains how to give operator rights.


Essential Minecraft commands

The most used commands, the ones to learn first.

CommandDescriptionExampleJavaBedrockAccess
/gamemodeChanges the game mode/gamemode creativeYesYesOperator
/tpTeleports players or entities/tp Steve 100 64 200YesYesOperator
/giveGives items/give @p diamond 64YesYesOperator
/killKills entities/kill @e[type=zombie]YesYesOperator
/timeSets the time of day/time set dayYesYesOperator
/weatherChanges the weather/weather clearYesYesOperator
/gameruleChanges the world rules/gamerule keep_inventory trueYesYesOperator
/effectApplies effects/effect give @p strength 60YesYesOperator
/summonSummons an entity/summon minecraft:horseYesYesOperator
/locateFinds a structure or a biome/locate structure fortressYesYesOperator

/gamemode, change the game mode

The most used command to switch between modes.

/gamemode <mode> [player]
ModeBedrock shortcutDescription
survival0 / sSurvival, the standard mode
creative1 / cCreative: flying and endless resources
adventure2 / aAdventure: blocks cannot be broken
spectatornoneSpectator: flies through blocks

Numbers and letters only work in Bedrock. Java has only accepted the full mode name since 1.13. Spectator mode has been available in Bedrock without experiments since 1.19.50.

Examples

/gamemode creative
/gamemode survival @a
/gamemode creative Steve
/gamemode 1 Steve

The last line is the Bedrock short form.

/tp and /teleport, teleport

Essential to move fast or bring a player back.

/tp <target> <destination>
/tp <target> <x> <y> <z>
SyntaxDescription
/tp Steve AlexTeleports Steve to Alex
/tp @p 100 64 -300Teleports the nearest player to the coordinates
/tp @a ~ ~10 ~Lifts every player by 10 blocks
/tp @e[type=cow] @pBrings every cow to the player

The ~ symbol stands for the current position. ~10 means 10 more blocks on that axis. The ^ symbol counts from where you look: ^ ^ ^5 is 5 blocks in front of you.

/give, give items

Hands out items to players.

/give <player> <item> [amount]
ExampleResult
/give @p diamond 6464 diamonds to the nearest player
/give @a minecraft:torch 3232 torches to every player
/give Steve netherite_swordA netherite sword to Steve
/give @p enchanted_golden_appleAn enchanted golden apple

/gamerule, game rules

Changes the basic rules of the world. Java renamed all its rules in 1.21.11: they are now written in lowercase with underscores. Bedrock keeps its one-word names.

/gamerule <rule> <value>
Java 26.3BedrockFormer Java nameEffect
keep_inventorykeepinventorykeepInventoryKeep the inventory after death
advance_timedodaylightcycledoDaylightCycleDay and night cycle
spawn_mobsdomobspawningdoMobSpawningMob spawning
mob_griefingmobgriefingmobGriefingMobs can destroy blocks
natural_health_regenerationnaturalregenerationnaturalRegenerationNatural health regeneration
fire_spread_radius_around_playerdofiretickdoFireTickFire spread (Java: radius in blocks, 0 turns it off)
fall_damagefalldamagefallDamageFall damage
pvppvp(new in 1.21.9)Player versus player combat

Common commands, in Java then in Bedrock:

/gamerule keep_inventory true
/gamerule advance_time false
/gamerule mob_griefing false

/gamerule keepinventory true
/gamerule dodaylightcycle false
/gamerule mobgriefing false

The Guide to Minecraft gamerules covers every rule and its former name.

/time, manage the time

Controls the time of day. A Minecraft day lasts 24,000 ticks.

/time set <value>
/time add <ticks>
/time query <daytime|gametime|day>
ValueTicksTime of day
day1000Morning
noon6000Noon
night13000Start of the night
midnight18000Midnight
sunrise23000Sunrise (Bedrock only)
sunset12000Sunset (Bedrock only)

Examples

/time set day
/time set 6000
/time add 1000

Since 26.1, Java handles time through world clocks. The commands above work as before, and /time pause, /time resume and /time rate <multiplier> were added.

/weather, the weather

Sets the weather, with an optional duration.

/weather <clear|rain|thunder> [duration]
CommandEffect
/weather clearClear weather
/weather rainRain, or snow in cold biomes
/weather thunderThunderstorm with lightning
/weather clear 1dClear weather for one game day (Java)
/weather clear 24000Clear weather for 24,000 ticks, one game day

Duration is counted in ticks in both editions. Java also accepts the s (real seconds) and d (game days) suffixes.


Game mode and player commands

These Minecraft commands change the state of players.

CommandDescriptionExampleJavaBedrockAccess
/effectPotion effects/effect give @p speed 120 2YesYesOperator
/xpGives experience/xp add @p 30 levelsYesYesOperator
/enchantEnchants an item/enchant @p sharpness 5YesYesOperator
/clearClears the inventory/clear @pYesYesOperator
/difficultyChanges the difficulty/difficulty hardYesYesOperator
/defaultgamemodeDefault mode for new players/defaultgamemode survivalYesNoOperator
/attributeChanges attributes/attribute @p minecraft:max_health base set 40YesNoOperator
/spectateWatches an entity as a spectator/spectate @e[type=bat,limit=1]YesNoOperator
/abilitySpecial abilities (Education)/ability @p mayfly trueNoYesOperator
/immutableworldMakes the world immutable/immutableworld trueNoYesOperator

/effect, potion effects

Applies or removes status effects. The syntax differs between editions: Java uses give and clear, Bedrock does not.

# Java
/effect give <target> <effect> [duration|infinite] [amplifier] [hide_particles]
/effect clear <target> [effect]
# Bedrock
/effect <target> <effect> [duration|infinite] [amplifier] [hide_particles]
/effect <target> clear
EffectNumeric IDDescription
speed1Movement speed
strength5Attack strength
jump_boost8Higher jumps
regeneration10Health regeneration
resistance11Damage resistance
fire_resistance12Fire immunity
invisibility14Invisibility
night_vision16Night vision

Commands expect the effect name. The number is the internal ID, useful when reading old tutorials. The word infinite gives a never-ending effect (Java 1.19.4, Bedrock 1.21.40).

Examples

/effect give @p night_vision infinite 0 true
/effect give @a resistance 60 4
/effect clear @p
/effect @p speed 30 1

The last line is the Bedrock form.

/xp, experience

Manages player experience. Java and Bedrock use different syntaxes.

CommandEditionEffect
/xp add @p 1000 pointsJavaGives 1,000 experience points
/xp add @p 30 levelsJavaGives 30 levels
/xp set @p 0 levelsJavaResets the level to zero
/xp query @p levelsJavaShows the current level
/xp 1000 @pBedrockGives 1,000 experience points
/xp 30L @pBedrockGives 30 levels
/xp -10L @pBedrockRemoves 10 levels

/enchant, enchantments

Enchants the item held in hand, up to the enchantment's maximum level.

/enchant <target> <enchantment> [level]
EnchantmentMax levelItems
sharpness5Swords, axes
efficiency5Tools
unbreaking3Any equipment
fortune3Pickaxes, axes, shovels
looting3Swords
protection4Armor
mending1Any equipment

Examples

/enchant @p sharpness 5
/enchant @p unbreaking 3
/enchant @p mending 1

/difficulty, difficulty

/difficulty <level>
LevelBedrock shortcutEffects
peaceful0 / pNo monsters, fast regeneration
easy1 / eWeak monsters, hunger does not kill
normal2 / nBalanced
hard3 / hStrong monsters, zombies break doors

Environment and world commands

These Minecraft commands act on the world itself.

CommandDescriptionExampleJavaBedrockAccess
/timeTime of day/time set noonYesYesOperator
/weatherWeather/weather thunderYesYesOperator
/gameruleGame rules/gamerule spawn_mobs falseYesYesOperator
/worldborderWorld border/worldborder set 1000YesNoOperator
/forceloadKeeps chunks loaded/forceload add 0 0YesNoOperator
/tickControls the game speed/tick freezeYesNoOperator
/fillbiomeChanges the biome of an area/fillbiome ~ ~ ~ ~20 ~10 ~20 minecraft:jungleYesNoOperator
/daylockLocks the day and night cycle/daylock trueNoYesOperator
/toggledownfallToggles rain/toggledownfallNoYesOperator
/tickingareaAlways active areas/tickingarea add circle ~ ~ ~ 4 farmNoYesOperator
/mobeventMob events/mobevent minecraft:pillager_patrols_event falseNoYesOperator
/fogFog/fog @p push minecraft:fog_hell myfogNoYesOperator

/worldborder, the world border (Java)

Manages the edge of the world. Since 1.21.9, it only affects the dimension where the command runs.

/worldborder <set|add|center|damage|warning|get> ...
CommandEffect
/worldborder set 5000Border 5,000 blocks wide
/worldborder set 1000 60sShrinks to 1,000 blocks over one minute
/worldborder center 0 0Centers the border on 0, 0
/worldborder add 500Grows by 500 blocks
/worldborder damage amount 11 damage point per block outside the border

Since 1.21.11, the duration is given in ticks. Add s for real seconds or d for game days.

/forceload, chunks kept loaded (Java)

Keeps chunks loaded at all times, for an automatic farm for example. Each forced chunk uses resources, even with no player nearby.

/forceload add <x> <z>
/forceload remove <x> <z>
/forceload query
CommandEffect
/forceload add 0 0Loads the chunk at 0, 0
/forceload add -100 -100 100 100Loads a whole area
/forceload remove allUnloads all forced chunks

/tickingarea, ticking areas (Bedrock)

The Bedrock equivalent of /forceload.

/tickingarea add <x1> <y1> <z1> <x2> <y2> <z2> <name>
/tickingarea add circle <x> <y> <z> <radius> <name>
/tickingarea remove <name>
/tickingarea list

/tick, control the game speed (Java)

Added in 1.20.3, it freezes or speeds up the game and measures server load. It needs operator level 3.

CommandEffect
/tick queryShows the target rate and the average time per tick
/tick freezeFreezes the world, except players
/tick unfreezeResumes the world
/tick step 20Steps 20 ticks forward while frozen
/tick rate 40Targets 40 ticks per second instead of 20
/tick sprint 1dRuns one game day as fast as possible

The guide Ticks, TPS and main thread on Minecraft explains what these figures mean.


Teleportation commands

These Minecraft commands move players and find places.

CommandDescriptionExampleJavaBedrockAccess
/tpTeleport/tp @p 0 100 0YesYesOperator
/teleportLong form of /tp/teleport Steve AlexYesYesOperator
/spawnpointA player's respawn point/spawnpoint @p ~ ~ ~YesYesOperator
/clearspawnpointRemoves the respawn point/clearspawnpoint @pNoYesOperator
/setworldspawnWorld spawn point/setworldspawn 0 64 0YesYesOperator
/spreadplayersSpreads at random/spreadplayers 0 0 100 500 false @aYesYesOperator
/rotateTurns an entity (Java 1.21.2)/rotate @p 90 0YesNoOperator
/locateFinds a structure or a biome/locate structure strongholdYesYesOperator
/placeGenerates a structure/place structure village_plainsYesYesOperator
/structureSaves and loads structures/structure save house ~ ~ ~ ~10 ~10 ~10NoYesOperator

/locate, find a structure

Gives the coordinates of the nearest structure.

/locate structure <type>
/locate biome <biome>
/locate poi <poi>
StructureCommand
Stronghold/locate structure stronghold
Village (Java)/locate structure #village
Village (Bedrock)/locate structure village
Woodland mansion/locate structure mansion
Ocean monument/locate structure monument
Bastion/locate structure bastion_remnant
Nether fortress/locate structure fortress
Ancient city/locate structure ancient_city
Trial chambers/locate structure trial_chambers

In Java, village is a group rather than a structure, so type #village. Bedrock accepts village.

Find a biome:

/locate biome minecraft:mushroom_fields
/locate biome minecraft:cherry_grove

/spreadplayers, spread players

Teleports players at random within an area, handy to start a match.

/spreadplayers <x> <z> <min_distance> <max_range> <respectTeams> <targets>
ParameterDescription
x zCenter of the area
min_distanceMinimum gap between players
max_rangeMaximum spread radius
respectTeamstrue keeps teams together

Example:

/spreadplayers 0 0 50 500 false @a

Here every player lands between 50 and 500 blocks from the center.

/spawnpoint and /setworldspawn

These two commands set respawn points.

CommandScopeExample
/spawnpointOne player/spawnpoint Steve 100 64 100
/setworldspawnEveryone/setworldspawn 0 64 0

Building and editing commands

These Minecraft commands build on a large scale.

CommandDescriptionExampleJavaBedrockAccess
/setblockPlaces a block/setblock ~ ~ ~ diamond_blockYesYesOperator
/fillFills an area/fill 0 0 0 10 10 10 stoneYesYesOperator
/cloneCopies an area/clone 0 0 0 10 10 10 20 0 0YesYesOperator
/giveGives items/give @p diamond_pickaxeYesYesOperator
/clearClears the inventory/clear @p dirtYesYesOperator
/lootGenerates loot/loot give @p loot minecraft:chests/simple_dungeonYesYesOperator
/itemManages item slots/item replace entity @p weapon.mainhand with diamond_swordYesNoOperator
/replaceitemReplaces the item in a slot/replaceitem entity @p slot.weapon.mainhand 0 diamond_swordNoYesOperator
/fillbiomeChanges the biome/fillbiome ~ ~ ~ ~10 ~10 ~10 cherry_groveYesNoOperator

/setblock, place a block

Places a specific block at a position.

/setblock <x> <y> <z> <block> [mode]
ModeEffect
replaceReplaces anything (default)
destroyBreaks the old block and drops it
keepOnly replaces air

Examples

/setblock ~ ~-1 ~ minecraft:glass
/setblock 100 64 100 diamond_block destroy
/setblock ~ ~ ~ air destroy

/fill, fill an area

Fills a volume with a block.

/fill <x1> <y1> <z1> <x2> <y2> <z2> <block> [mode]
ModeEffect
replaceReplaces everything
destroyDestroys the blocks and drops the items
keepOnly replaces air
hollowHollow cube, the inside becomes air
outlineOutline only
replace <old>Replaces one block type only

Examples

/fill ~ ~ ~ ~10 ~10 ~10 stone hollow
/fill 0 0 0 100 50 100 air replace water
/fill ~ ~-1 ~ ~20 ~-1 ~20 grass_block

One command changes 32,768 blocks at most. In Java, this limit is set by the max_block_modifications rule (commandModificationBlockLimit before 1.21.11).

/clone, copy an area

Copies a region to another place.

/clone <x1> <y1> <z1> <x2> <y2> <z2> <dest_x> <dest_y> <dest_z> [mode]
ModeEffect
replaceCopies everything
maskedSkips air blocks
filtered <block>Copies only that block
moveMoves and clears the source

Examples

/clone 0 64 0 10 74 10 100 64 100
/clone ~ ~ ~ ~10 ~10 ~10 ~20 ~ ~ masked

Entities and mobs commands

These Minecraft commands handle mobs and other entities.

CommandDescriptionExampleJavaBedrockAccess
/summonSummons an entity/summon zombie ~ ~ ~YesYesOperator
/killKills entities/kill @e[type=!player]YesYesOperator
/tpTeleports entities/tp @e[type=cow] @pYesYesOperator
/effectEffects on entities/effect give @e[type=zombie] slowness 30YesYesOperator
/tagTags entities/tag @e[type=pig] add markedYesYesOperator
/dataReads and edits NBT data/data get entity @pYesNoOperator
/damageDeals damage/damage @p 5 magicYesYesOperator
/rideMounts an entity on another/ride @p mount @e[type=horse,limit=1,sort=nearest]YesYesOperator
/swingSwings the arm (Java 26.1)/swing @e[type=zombie,limit=1]YesNoOperator
/bossbarBoss bars/bossbar add my_boss "Boss"YesNoOperator
/eventTriggers an entity event/event entity @e[type=creeper] minecraft:start_exploding_forcedNoYesOperator

Entity selectors

Selectors pick the targets of a command.

SelectorTarget
@pNearest player
@aAll players
@rRandom player
@eAll entities
@sWhoever runs the command
@nNearest entity (Java 1.21)

Common filters:

FilterExampleEffect
type@e[type=zombie]Zombies only
distance@e[distance=..10]Within 10 blocks
limit@e[limit=1]One entity only
sort@e[sort=nearest]Sorts by distance
tag@e[tag=boss]With the "boss" tag
name@e[name="Steve"]Named "Steve"

In Bedrock, limit is written c: @e[type=zombie,c=1].

/summon, summon

Spawns an entity. The data in braces (NBT) only works in Java.

/summon <entity> [x] [y] [z] [nbt]
ExampleResult
/summon zombieA zombie at your position
/summon creeper ~ ~ ~ {Fuse:0}A creeper that explodes at once
/summon horse ~ ~ ~ {Tame:1b}A tamed horse
/summon lightning_boltA lightning bolt
/summon item ~ ~ ~ {Item:{id:"minecraft:diamond",count:64}}64 diamonds on the ground

Since 1.20.5, an item's quantity is written count in lowercase. The old Count form no longer works. Since 1.21.9, /summon refuses monsters on Peaceful difficulty.

/kill, remove entities

/kill <target>
CommandEffect
/kill @eKills everything, you included
/kill @e[type=!player]Kills everything except players
/kill @e[type=item]Removes dropped items
/kill @e[type=zombie,distance=..50]Zombies within 50 blocks
/kill @e[type=experience_orb]Removes experience orbs

/kill @e also removes tamed animals, item frames and armor stands. Always add a type filter.

/tag, tag entities

Adds tags to entities so you can target them later.

/tag <target> add <name>
/tag <target> remove <name>
/tag <target> list

Usage:

/tag @e[type=pig,limit=1] add special
/kill @e[tag=special]

Server administration commands

These Minecraft commands manage players and the server. On an OuiHeberg server, type them in the OuiPanel console, without the slash.

CommandDescriptionExampleJavaBedrockAccess
/opGrants operator rights/op SteveYesYesOperator
/deopRemoves operator rights/deop SteveYesYesOperator
/kickKicks a player/kick Steve ReasonYesYesOperator
/banBans a player/ban Steve CheatingYesNoOperator
/pardonLifts a ban/pardon SteveYesNoOperator
/ban-ipBans an IP address/ban-ip 192.168.1.1YesNoOperator
/pardon-ipLifts an IP ban/pardon-ip 192.168.1.1YesNoOperator
/banlistBan list/banlistYesNoOperator
/whitelistWhitelist/whitelist add SteveYesYes (alias)Operator
/allowlistAllowlist/allowlist add SteveNoYesOperator
/listOnline players/listYesYesEveryone
/stopStops the server/stopYesYesOperator
/save-allSaves the world to disk/save-allYesNoOperator
/save-onTurns on autosave/save-onYesNoOperator
/save-offTurns off autosave/save-offYesNoOperator
/savePrepares a world backup/save holdNoYesOperator
/setidletimeoutKicks idle players/setidletimeout 10YesNoOperator
/setmaxplayersPlayer limit/setmaxplayers 20NoYesOperator
/permissionReloads permissions (Bedrock server)/permission reloadNoYesOperator
/transferSends a player to another server/transfer play.example.com 25565 SteveYesYesOperator
/versionShows the server version (Java 1.21.6)/versionYesNoOperator

On a Bedrock server, /permission can also be typed /ops. It reloads the permissions.json file.

/whitelist and /allowlist

Manage the list of allowed players. On Bedrock, /whitelist is another name for /allowlist.

CommandEffect
/whitelist onTurns the whitelist on
/whitelist offTurns it off
/whitelist add SteveAllows Steve
/whitelist remove SteveRemoves Steve
/whitelist listShows the list
/whitelist reloadReloads the list from the file

Since Java 26.3, the white-list line of a new server.properties file is true. If your friends are turned away from a freshly created server, add them with /whitelist add or set that line to false.


Communication commands

These Minecraft commands send messages and titles.

CommandDescriptionExampleJavaBedrockAccess
/sayPublic message/say Welcome!YesYesOperator
/tellPrivate message/tell Steve HiYesYesEveryone
/msgAlias of /tell/msg Steve HelloYesYesEveryone
/wAlias of /tell/w Steve HiYesYesEveryone
/meAction message/me dancesYesYesEveryone
/teammsgTeam message/teammsg Let's attack!YesNoEveryone
/tmAlias of /teammsg/tm Ready?YesNoEveryone
/tellrawJSON message/tellraw @a {"text":"Hi"}YesYesOperator
/titleOn-screen title/title @a title "Victory"YesYesOperator
/titlerawJSON title/titleraw @a title {"rawtext":[{"text":"Victory"}]}NoYesOperator
/dialogShows a dialog box (Java 1.21.6)/dialog show @p minecraft:server_linksYesNoOperator
/helpCommand help/help gamemodeYesYesEveryone

/title, show a title

Shows large text in the middle of the screen.

/title <target> <title|subtitle|actionbar> <text>
/title <target> times <fadeIn> <stay> <fadeOut>
/title <target> clear
CommandEffect
/title @a title "Welcome"Main title
/title @a subtitle "Have fun"Subtitle
/title @a actionbar "Score: 100"Action bar, above the hotbar
/title @a times 20 60 20Durations in ticks

With JSON formatting (Java):

/title @a title {"text":"VICTORY","color":"gold","bold":true}

/tellraw, formatted message

Sends a formatted message, with colors and click actions.

/tellraw <target> <json>
PropertyValues
textThe text to show
colorred, green, blue, gold, etc.
boldtrue / false
italictrue / false
underlinedtrue / false
click_eventClick action (Java 1.21.5 and later, clickEvent before)

Java 1.21.5 and later:

/tellraw @a {"text":"Click here","color":"green","click_event":{"action":"run_command","command":"/tp @s 0 100 0"}}

Java 1.21.4 and earlier:

/tellraw @a {"text":"Click here","color":"green","clickEvent":{"action":"run_command","value":"/tp @s 0 100 0"}}

Bedrock:

/tellraw @a {"rawtext":[{"text":"§aClick here"}]}

On Bedrock, the text goes into a rawtext array. Colors use § codes, and click actions do not exist.


Scoreboard commands and objectives

These Minecraft commands keep score and organize teams.

CommandDescriptionExampleJavaBedrockAccess
/scoreboardManages scores/scoreboard objectives add deaths deathCountYesYesOperator
/teamManages teams/team add RedYesNoOperator
/triggerObjective players can trigger/trigger my_objective add 1YesNoEveryone
/advancementAdvancements/advancement grant @p everythingYesNoOperator
/recipeRecipes/recipe give @p *YesYesOperator

/scoreboard, the score system

Objectives:

/scoreboard objectives add <name> <criteria> [displayName]
/scoreboard objectives remove <name>
/scoreboard objectives setdisplay <slot> <objective>
CriteriaDescription
dummyChanged by commands only
deathCountNumber of deaths
playerKillCountPlayers killed
totalKillCountEntities killed
healthHealth points
xpExperience points
levelExperience level

Criteria other than dummy are Java only. Bedrock only knows dummy.

Players:

/scoreboard players set <player> <objective> <score>
/scoreboard players add <player> <objective> <value>
/scoreboard players remove <player> <objective> <value>
/scoreboard players reset <player>

Full example (Java):

/scoreboard objectives add Kills playerKillCount "Kills"
/scoreboard objectives setdisplay sidebar Kills
/scoreboard players set Steve Kills 10

/team, teams (Java)

/team add <name> [displayName]
/team remove <name>
/team join <team> <players>
/team leave <players>
/team modify <team> <option> <value>
OptionValues
colorred, blue, green, etc.
friendlyFiretrue / false
seeFriendlyInvisiblestrue / false
nametagVisibilityalways, never, hideForOtherTeams, hideForOwnTeam
collisionRulealways, never, pushOtherTeams, pushOwnTeam

Example:

/team add Red
/team modify Red color red
/team join Red Steve Alex

Advanced technical commands

Minecraft commands for map makers and advanced admins.

CommandDescriptionExampleJavaBedrockAccess
/executeConditional execution/execute as @a run say HiYesYesOperator
/functionRuns a function/function namespace:fileYesYesOperator
/scheduleSchedules a function/schedule function pack:end 10sYesYesOperator
/returnEnds a function and returns a value (Java 1.20)/return 1YesNoOperator
/randomDraws a random number (Java 1.20.2)/random roll 1..6YesNoEveryone
/dataReads and edits NBT/data get entity @pYesNoOperator
/datapackManages data packs/datapack listYesNoOperator
/reloadReloads data packs and functions/reloadYesYesOperator
/seedShows the world seed/seedYesNoEveryone in single player, operator on a server
/debugDebug session/debug startYesNoOperator
/perfMeasures performance/perf startYesNoOperator
/jfrJava Flight Recorder profiling/jfr startYesNoOperator
/publishOpens the world to LAN/publishYesNoOperator
/unpublishCloses LAN (Java 26.2)/unpublishYesNoOperator
/particleCreates particles/particle minecraft:heart ~ ~2 ~YesYesOperator
/playsoundPlays a sound/playsound minecraft:entity.experience_orb.pickup master @pYesYesOperator
/stopsoundStops a sound/stopsound @aYesYesOperator
/musicControls the music/music play record.catNoYesOperator
/camerashakeShakes the camera/camerashake add @p 1 5NoYesOperator
/cameraMoves the camera, screen fade/camera @p fade time 1 2 1NoYesOperator
/playanimationPlays an animation/playanimation @e[type=villager] animation.villager.generalNoYesOperator

/execute, the most powerful

Runs a command under conditions, as another entity or at another place. Java and Bedrock have shared this syntax since Bedrock 1.19.50.

/execute <subcommands> run <command>
SubcommandEffect
as <entity>Runs as the entity
at <entity>Runs at the entity's position
positioned <x y z>Runs at that position
if block <x y z> <block>If that block is there
if entity <target>If the entity exists
if score <target> <obj> ...If the score matches
unless ...The opposite of if
store result ...Stores the result (Java)

Examples

/execute as @e[type=zombie] at @s run summon lightning_bolt ~ ~ ~
/execute if block ~ ~-1 ~ diamond_block run say Diamond!
/execute as @a at @s if block ~ ~-1 ~ lava run kill @s
/execute positioned 0 100 0 run summon tnt

/data, edit NBT (Java)

Reads and changes the NBT data of blocks and entities.

/data get <block|entity> <target> [path]
/data merge <block|entity> <target> <nbt>
/data modify <block|entity> <target> <path> <operation> ...
/data remove <block|entity> <target> <path>

Examples

/data get entity @p Inventory
/data merge entity @e[type=creeper,limit=1] {Fuse:0}
/data modify entity @e[type=item,limit=1,sort=nearest] Item.count set value 64

A player's data can be read but not changed with /data. For their inventory, use /item or /give.

/function, functions

Runs a .mcfunction file from a data pack, or from a behavior pack in Bedrock.

/function <namespace>:<path>

Example:

/function mypack:setup/init
/function minecraft:tick

/schedule, delayed execution

Schedules a function for later.

/schedule function <function> <time> [append|replace]
/schedule clear <function>
TimeEquivalent
10t10 ticks, half of 1s
5s100 ticks
1dOne game day, 24,000 ticks

These suffixes are the Java ones. In Bedrock, /schedule mainly runs a function once an area is loaded (/schedule on_area_loaded).

Other commands

These commands complete the list. They are mostly used by Bedrock content creators and on Bedrock dedicated servers.

CommandEditionPurpose
/experienceJavaLong form of /xp
/alwaysdayBedrockAlias of /daylock
/?BedrockAlias of /help
/inputpermissionBedrockBlocks or restores a player's movement controls
/controlschemeBedrockSwitches the control scheme
/aimassistBedrock, experimentalSets aim assist
/dialogueBedrockOpens an NPC dialogue
/scripteventBedrockTriggers a script event
/scriptBedrockScript debugging
/worldbuilder / /wbBedrockAllows editing restricted blocks
/wsserver / /connectBedrockConnects to a WebSocket server
/dedicatedwsserverBedrock, dedicated serverServer WebSocket connection
/changesettingBedrock, dedicated serverChanges a server setting
/reloadconfigBedrock, dedicated serverReloads configuration files
/reloadpacketlimitconfigBedrock, dedicated serverReloads the packet limit settings
/gametestBedrock, dedicated serverGameTest tools
/editor-allowlistBedrock, dedicated serverEditor allowlist
/projectBedrock, dedicated serverManages Editor projects
/partyBedrockParty chat message
/sendshowstoreofferBedrockShows a store offer

Commands added since 2023

Mojang has numbered versions by year since 2026: after 1.21.11 came 26.1, 26.2 and 26.3. Here are the commands added since 1.20.

CommandEdition and versionPurpose
/returnJava 1.20Ends a function and returns a value
/randomJava 1.20.2Draws a random number
/tickJava 1.20.3Freezes, speeds up or measures the game
/transferJava 1.20.5, Bedrock 1.20.30Sends a player to another server
/rotateJava 1.21.2Turns an entity
/testJava 1.21.5Runs game tests (GameTest)
/versionJava 1.21.6Shows the server version
/waypointJava 1.21.6Manages locator bar waypoints
/dialogJava 1.21.6Shows a dialog box
/fetchprofileJava 1.21.9Fetches a player's profile
/stopwatchJava 1.21.11Real-time stopwatches
/swingJava 26.1Swings an entity's arm
/unpublishJava 26.2Closes the world to LAN
/posteffectJava 26.3Adds or removes a post effect
/computeJava 26.3Computes a value (number provider)
/cameraBedrock 1.20.0Controls the camera
/recipeBedrock 1.20.10Gives or takes recipes
/hudBedrock 1.20.60Hides or shows HUD elements
/gametipsBedrock 1.20.80Turns game tips on or off
/set_movement_authorityBedrock 1.21.50Sets movement checks
/placeBedrock 1.21.50 à 1.21.80Places structures, out of experiments in 1.21.80

Obsolete Minecraft commands

These commands were removed or replaced. Old tutorials still mention them.

Old commandRemoved inReplaced by
/testforJava 1.13/execute if entity
/testforblockJava 1.13/execute if block
/testforblocksJava 1.13/execute if blocks
/blockdataJava 1.13/data merge block
/entitydataJava 1.13/data merge entity
/replaceitemJava 1.17/item replace
/achievementJava 1.12/advancement
/toggledownfallJava 1.13/weather
/statsJava 1.13/execute store
/locatebiomeJava 1.19/locate biome
/placefeatureJava 1.19/place feature
/opreloadBedrock/permission reload
/volumeareaBedrock 1.21.20none

/testfor, /testforblock, /testforblocks, /replaceitem and /toggledownfall still exist in Bedrock.

Game rules renamed in Java 1.21.11

A /gamerule command copied from an old tutorial often fails because of these new names. The most common ones:

Old nameName in Java 26.3
doDaylightCycleadvance_time
doWeatherCycleadvance_weather
doMobSpawningspawn_mobs
doInsomniaspawn_phantoms
doMobLootmob_drops
doTileDropsblock_drops
naturalRegenerationnatural_health_regeneration
spawnRadiusrespawn_radius
announceAdvancementsshow_advancement_messages
disableRaidsraids (inverted value)
doFireTickremoved, replaced by fire_spread_radius_around_player

The full list is in the guide to Minecraft gamerules.


The most searched commands

Short answers to the most frequent questions, for each edition.

NeedJavaBedrock
Keep your inventory/gamerule keep_inventory true/gamerule keepinventory true
Switch to creative/gamemode creative/gamemode creative
Teleport/tp Steve 100 64 200/tp Steve 100 64 200
Make it day/time set day/time set day
Stop the rain/weather clear/weather clear
Lock daytime/gamerule advance_time false/daylock true
Get items/give @p diamond 64/give @p diamond 64
Spawn a mob/summon minecraft:wither/summon wither
Find a village/locate structure #village/locate structure village
Show coordinatesF3 key/gamerule showcoordinates true
Give a player operator rightsop Steveop Steve

The last line is typed in the server console, without a slash. For Bedrock-specific commands, the guide Minecraft Bedrock commands goes further.


Need help?

Open a ticket from Tickets › Open a Ticket, or from the Contact support tile at the bottom of your server's page in the client area. You can also ask your question on the OuiHeberg Discord.

Was this article helpful?

18,764 views
Share this article
Need a Minecraft server?

Discover our Minecraft hosting plans starting from $2.28/month with automatic mod installation.

Minecraft server hosting →

Related Articles