Skip to content

Gameplay commands ​

Short descriptions of standard commands. For server management commands such as allowlist, stop, and save, see Commands.

In the console: leave off /. help <command> shows the syntax your version accepts. Commands that work from the player's position usually need execute first:

text
execute as "Gamertag" at @s run fill ~ ~ ~ ~5 ~5 ~5 stone

Some commands need allow-cheats=true, and some are Education-only or experimental. Change who may use a command with commands.json.

Players ​

CommandPurpose
clearRemove items from an inventory
clearspawnpointRemove a saved spawn point
effectAdd or remove an effect
enchantEnchant a held item
gamemodeChange game mode
giveGive an item
inputpermissionControl player input
hudShow or hide interface parts
lootGive or spawn loot
recipeUnlock or lock recipes
replaceitemReplace an inventory item
spawnpointSet a player's spawn
tagAdd or remove a label
tp, teleportMove players or entities
xpChange experience

World ​

CommandPurpose
alwaysday, daylockLock daylight
cloneCopy blocks
difficultySet difficulty
fillFill an area
fogControl fog
gameruleRead or change a rule
locateFind a structure or biome
mobeventToggle mob events
placePlace a structure or feature
setblockSet one block
setworldspawnSet world spawn
structureSave, load, or delete structures
tickingareaManage ticking areas
timeRead or change time
toggledownfall, weatherControl weather

Entities ​

CommandPurpose
damageDeal damage
eventTrigger an entity event
killRemove entities
playanimationPlay an animation
rideControl riding
spreadplayersScatter targets
summonCreate an entity
testforCount matching targets

Chat, sound and camera ​

CommandPurpose
cameraControl a player's camera
camerashakeShake the camera
dialogueOpen or change NPC dialogue
meAction-style message
musicControl music
particleShow particles
playsound, stopsoundControl sounds
sayMessage everyone
tell, msg, wPrivate message
tellraw, titlerawJSON-formatted text
titleOn-screen title

Automation ​

CommandPurpose
executeRun a command as, at, or under a condition
functionRun a behavior-pack function
scheduleRun a function later
scoreboardManage scores
scripteventSend an event to scripts
testforblock, testforblocksCompare blocks
wsserver, connectConnect to a WebSocket server

Less common ​

CommandPurpose
aimassistControl aim assist
controlschemeChange a player's control scheme
gametestRun and manage GameTests

Not in the server's list ​

The game's language files also name these, but the 1.26.66.1 server does not list them, even with cheats on.

ability, gametips, closewebsocket, gettopsolidblock, querytarget, achievement, classroommode, clearfixedinv, clearrealmevents, code, compactdb, corruptworld, debug, educlientinfo, getchunkdata, getchunks, getlocalplayername, getspawnpoint, globalpause, immutableworld, itemswithtag, lesson, setfixedinvslot, setfixedinvslots, setmovementauthority, tagsfromitem, validategamelighting, volumearea, worldbuilder

For exact arguments, see Command syntax.

Unofficial community wiki. Not approved by or associated with Mojang or Microsoft.