Minecraft Commands List: Full Java & Bedrock Reference (26.2)

This is a complete, verified reference to Minecraft commands as they work in Java Edition 26.2 (“Chaos Cubed”, released June 16, 2026, under the new YY.D.H year-based version numbering). It covers every core command’s syntax, its required operator (OP) level, the full game-rule list with types and defaults, and the target selectors that let one command affect many players or entities at once. Where the equivalent Bedrock Edition behaves differently, that difference is called out explicitly.

To run any of these, open the chat window (press T or / on Java; tap the chat bubble on Bedrock) and type the command starting with a slash. On a multiplayer server you type them in the server console (no slash) or in-game if you are an operator. In single-player, cheats must be enabled (“Allow Cheats” / Open to LAN with cheats). Speed things up with our free Give Command generator, Summon Command builder, Gamerule Browser, Target Selector helper, and Execute Command builder — or spin the whole world up on Minecraft server hosting.

Full Minecraft command reference (Java 26.2)

CommandSyntaxDescriptionOP
/givegive [components] []Give items to players (count 1–2147483647, default 1).2
/clearclear [] [] []Remove items; no args clears the whole inventory.2
/gamemodegamemode []Set survival, creative, adventure, or spectator.2
/defaultgamemodedefaultgamemode Set the mode new players get on first join.2
/difficultydifficulty [peaceful|easy|normal|hard]Set or (no arg) query world difficulty.2
/effecteffect give [|infinite] [] []Add or clear status effects.2
/enchantenchant []Enchant the held item (respects max level).2
/experience (/xp)experience add|set|query [levels|points]Add, set, or query experience.2
/summonsummon [] []Spawn an entity (not players/bobbers).2
/killkill []Instantly kill targets; no arg kills the executor.2
/teleport (/tp)teleport []Move entities to coords or another entity.2
/spreadplayersspreadplayers Randomly scatter targets around a point.2
/timetime set|add|query …Set, advance, or query world time.2
/weatherweather (clear|rain|thunder) []Set weather for an optional duration (seconds).2
/setblocksetblock [destroy|keep|replace|strict]Place a single block.2
/fillfill [destroy|hollow|keep|outline|replace|strict]Fill a box between two corners.2
/gamerulegamerule []Set or query a game rule (see table below).2
/locatelocate structure|biome|poi Find the nearest structure, biome, or POI.2
/seedseedDisplay the world’s numeric seed.2
/spawnpointspawnpoint [] [] []Set a player’s personal respawn point.2
/setworldspawnsetworldspawn [] []Set the world’s global spawn point.2
/saysay Broadcast a prefixed message to everyone.2
/tellrawtellraw Send rich JSON/SNBT text (colors, clicks).2
/executeexecute run Run a command in a modified context.2
/opop Grant operator status (multiplayer only).3
/deopdeop Revoke operator status.3
/kickkick []Remove players from the server.3
/banban []Banlist a player (also ban-ip, banlist, pardon).3
/whitelistwhitelist add|remove|on|off|list|reloadManage the server allowlist.3
/publishpublish [] [] [] []Open a single-player world to LAN/online.4
/unpublishunpublishClose a published integrated server (new in 26.2).4
/team · /waypointteam modify color Set team/waypoint color (lowercase names only).2

Items, players, and entities

Since Java 1.20.5 — and still current in 26.2 — item commands use data components in square brackets instead of the old {NBT} tags. For example: give @p diamond_sword[enchantments={"minecraft:sharpness":10},custom_name='"Zap"'] 1. Use clear @s minecraft:dirt 64 to strip specific items. /enchant respects normal limits, so enchant @p minecraft:unbreaking 3 won’t exceed the cap, whereas /give with components can. See our deep dives on the give command, item IDs, and the enchantments list.

Entities still use SNBT — components are items-only, so don’t mix the two. summon creeper ~ ~ ~ {powered:true,CustomName:'"Powered Creeper"'} spawns a charged creeper at your feet, and kill @e[type=item] clears dropped items without touching mobs or players. Grant experience with xp add Alice 3 levels. Full walkthroughs live in our summon guide and commands overview.

Target selectors

SelectorMeaningExample
@pNearest playergive @p diamond
@aAll players (alive or dead)tellraw @a {"text":"Hi"}
@rRandom online playergamemode spectator @r
@sThe executing entitykill @s
@eAll alive entities in loaded chunkskill @e[type=item]
@nNearest alive entity (Java 1.21+)tp @s @n[type=cat]

Selectors take filter arguments in brackets: type, distance (range notation like ..10 or 3..), limit, sort (nearest/furthest/random/arbitrary), x/y/z with dx/dy/dz volumes, scores, nbt, gamemode, team, level, and more. Most are negatable, e.g. type=!zombie. A worked example: @e[type=item,distance=..5,limit=3,sort=nearest]. Our target selectors guide covers every argument.

Game rules

GameruleTypeDefaultEffect
keepInventoryBooleanfalseKeep inventory and XP on death.
doDaylightCycleBooleantrueDay/night cycle and moon phases progress.
doWeatherCycleBooleantrueWeather changes naturally.
doMobSpawningBooleantrueMobs spawn naturally.
mobGriefingBooleantrueMobs can alter blocks and pick up items.
doFireTickBooleantrueFire spreads and burns out.
doImmediateRespawnBooleanfalseRespawn instantly, no death screen.
commandBlockOutputBooleantrueCommand blocks broadcast output to ops.
sendCommandFeedbackBooleantrueCommand feedback shows in chat.
randomTickSpeedInteger3Random ticks per section per game tick.
doInsomniaBooleantruePhantoms spawn if a player hasn’t slept.
fallDamageBooleantruePlayers take fall damage.
naturalRegenerationBooleantrueHealth regenerates from full hunger.
showDeathMessagesBooleantrueDeath messages appear in chat.
doTileDropsBooleantrueBroken blocks drop items.
maxCommandChainLengthInteger65536Max commands per chain/function.
commandModificationBlockLimitInteger32768Max blocks per /fill, /clone, /fillbiome.
spawnRadiusInteger10Respawn radius around world spawn.
playersSleepingPercentageInteger100Percent of players who must sleep to skip night.
maxCommandForkCountInteger65536Max execution contexts (forks) per tick.

Rule names are case-sensitive camelCase in Java. Set one with gamerule keepInventory true or read it back by omitting the value: gamerule randomTickSpeed. Note that commandModificationBlockLimit (default 32768, added in 1.20.3) replaced the old hardcoded /fill cap, so raising it lets larger fills run: gamerule commandModificationBlockLimit 1000000. More in our gamerules list and keepInventory guide.

The /execute command

/execute runs another command in a modified context using subcommands: modifiers (as, at, positioned, rotated, facing, align, anchored, in, on, summon), conditions (if/unless against block, blocks, data, entity, predicate, score, biome, and more), and store to capture a result. Example: execute as @a at @s if block ~ ~-1 ~ #minecraft:wool run kill @s. In 26.2, execute on owner now counts vexes as owned by their evoker.

How to run these

Chat: press T or /, type the command, hit Enter. Command block: obtain one with give @p command_block, place it, and type the command without the leading slash; the block runs on a redstone pulse or continuously. Server console: type the command with no slash directly in the dedicated-server terminal — the console runs at the highest permission level, so it can execute anything including op, whitelist, and stop.

Java’s OP model gates commands by level: Level 2 covers gameplay/cheat commands (give, tp, summon, gamerule, fill…), Level 3 covers moderation (op, deop, kick, ban, whitelist), and Level 4 covers server administration (publish/unpublish, stop, save). Set the default operator level with op-permission-level in server.properties.

Java vs Bedrock notes

  • Item format: Java uses item_id[components]; Bedrock still uses numeric data values, e.g. give [amount] [data].
  • Shorthands: Bedrock accepts numeric game modes (0/1/2) and difficulties (0–3); Java uses names.
  • Effects: Java supports infinite duration; Bedrock has no infinite keyword and one combined form.
  • Selectors: Bedrock uses r/rm for distance, m for gamemode, c for limit, and lacks Java’s nbt= and team= filters. @n exists in both (Java 1.21 / Bedrock 1.21.100).
  • /execute: Bedrock lacks on, summon, data, dimension, loaded, predicate, items, function conditions, and all store subcommands; it processes depth-first vs Java’s breadth-first.
  • /tellraw: Bedrock wraps text in a rawtext object: tellraw @a {"rawtext":[{"text":"..."}]}.
  • Versioning: Java 26.2 corresponds to a differently numbered Bedrock build (Java 26.1 ↔ Bedrock 26.10).

FAQ

How do I turn on cheats to use commands?

In single-player, enable “Allow Cheats” (or Open to LAN with cheats on). On a server you must be an operator — add yourself with op from the console — or run commands directly in the server console, which needs no OP.

Why does my /give command say the item is invalid?

Since 1.20.5, Java uses data components in square brackets, not {NBT} tags. Write diamond_sword[enchantments={"minecraft:sharpness":5}], not the old NBT form. Our Give Command tool builds valid 26.2 syntax for you.

What changed for commands in 26.2?

/publish gained a leading online Boolean and auto-unpublishes an existing integrated server; the new /unpublish closes it. /team and /waypoint color arguments now accept only lowercase, underscore-separated names like dark_red. /execute on owner now treats vexes as owned by their evoker.

How do I keep my items when I die?

Run gamerule keepInventory true. It defaults to false and works identically in Java and Bedrock, keeping both your inventory and XP on death.

How do I teleport to specific coordinates?

Use teleport @a 100 64 -200 (or the alias /tp). You can add a rotation or facing a point/entity. Bedrock orders arguments differently and always faces feet. See our teleport commands guide.

What’s the difference between /op levels?

Level 1 bypasses spawn protection, level 2 unlocks gameplay/cheat commands, level 3 adds moderation (kick/ban/whitelist), and level 4 grants full server administration. Set the default with op-permission-level in server.properties.

Ready to play?

Run your own Minecraft server with XGamingServer

Spin up an always-on Minecraft server your friends can join in minutes — no port-forwarding, no tech headaches.

99.9%Uptime SLA
< 5 minInstant setup
24/7Human support
DDoSProtected
Instant setup Your server is live in minutes with a one-click control panel.
Mods & plugins Install mods, plugins and workshop content in a few clicks.
DDoS protected Enterprise DDoS mitigation keeps your server online 24/7.
Low-latency hardware Premium CPUs & NVMe SSDs for lag-free multiplayer.
Free backups Automatic backups so your world is never lost.
Real human support Gamers helping gamers — 24/7, no bots, no scripts.

Pick your Minecraft plan & play in minutes

See all plans
Starter $8.40/mo 4 GB RAM Renews $12/mo Buy now
Rookie $17.50/mo 8 GB RAM Renews $25/mo Buy now
Pro $24.50/mo 12 GB RAM Renews $35/mo Buy now