Gamemode
/gamemode <survival|creative|adventure|spectator> [player]Switch game mode for yourself or another player.
Java Edition · 1.21+
Copy-ready commands for survival, creative builds, and servers — teleport, give items (modern components), locate structures, gamerules, fill/clone, and execute. Not a dump of every obscure command: the ones people actually use.
Prefer clicking over typing?
Build give / summon / effect commands in the generator, then paste into chat.
Session only — redo after relaunch.
Cheats stay on permanently.
In the server console: op YourName
Command blocks need enable-command-block=true in server.properties.
One-tap copies for the commands people search most. Paste in chat (cheats/OP required).
Selectors pick who a command hits. Add filters in brackets: @e[type=zombie,distance=..15,limit=5]
| Selector | Means | Example |
|---|---|---|
| @s | Yourself (executor) | /gamemode creative @s |
| @p | Nearest player | /tp @p ~ ~5 ~ |
| @a | All players | /effect give @a speed 30 1 |
| @r | Random player | /tp @r @s |
| @e | All entities | /kill @e[type=item] |
Useful filters: type=, distance=.., name=, gamemode=, limit=, sort=nearest.
/ in chat.~ = current position, ~5 = five blocks offset.diamond_sword, not Diamond_Sword.[brackets] — not old {Enchantments:} on /give.Java Edition 1.21+ syntax. Search or filter by category — click any example to copy.
The commands most players open chat for first.
/gamemode <survival|creative|adventure|spectator> [player]Switch game mode for yourself or another player.
/tp <destination> · /teleport …Move players or entities to coordinates, another entity, or another dimension.
Relative coords use ~. Facing: /tp @s 0 70 0 facing 10 70 10
/give <player> <item>[components] [count]Spawn items into a player’s inventory. Modern Java uses item components in [brackets].
Pre-1.20.5 worlds used {Enchantments:[…]} NBT. Prefer components on current Java.
/locate structure <id> · /locate biome <id>Find the nearest structure or biome and print coordinates (chat clickable).
Old /locatebiome is gone — use /locate biome. Surface sulfur springs are not a separate biome, so /locate won’t find them.
/seedShows the world seed (needed for seed maps and sharing worlds).
/enchant <targets> <enchantment> [level]Adds an enchantment to the item currently held in the main hand. Caps at vanilla max levels.
For over-level enchants or multiple at once, use /give with enchantments={levels:{…}} instead.
/clear [targets] [item] [maxCount]Remove items from inventories. No item = clear everything.
/spawnpoint [targets] [pos] [angle]Set a player’s personal respawn point (like sleeping in a bed).
/setworldspawn [pos] [angle]Set the world spawn where new players and unbedded deaths appear.
/kill [targets]Remove entities. Be careful with @e — it includes you unless filtered.
/help [command]In-game syntax help for any command.
Time, weather, effects, and gamerules.
/time set <day|night|noon|midnight|ticks>Set or query world time.
/weather <clear|rain|thunder> [durationSeconds]Force weather. Duration is in seconds on modern Java.
/effect give <targets> <effect> [seconds] [amplifier] [hideParticles]Apply or clear status effects. People search this for night vision, strength, and “god mode”.
/gamerule <rule> [value]Toggle world rules used by servers and map makers.
/difficulty <peaceful|easy|normal|hard>Set world difficulty.
/worldborder set <diameter> [seconds]Shrink or expand the playable area (UHC, events, SMP borders).
/xp add <targets> <amount> [points|levels] · /experience …Add or set experience points/levels.
/attribute <target> <attribute> <get|base set|modifier …>Read or change entity attributes (speed, health, scale, etc.).
Older worlds used minecraft:generic.max_health — tab-complete the current ID.
/recipe <give|take> <targets> <recipe|* >Unlock or revoke crafting recipes in the recipe book.
/advancement <grant|revoke> <targets> <everything|only|…>Give or remove advancements (achievements).
Fill, clone, summon, place — map-maker and creative tools.
/fill <from> <to> <block> [destroy|hollow|keep|outline|replace]Place or replace blocks in a box (hard limit ~32,768 blocks per command).
/clone <from> <to> <destination> [replace|masked|filtered] [force|move|normal]Copy a region of blocks to a new spot.
/summon <entity> [pos] [nbt]Spawn entities. Extra data still uses SNBT braces {…}.
/place structure|feature|jigsaw|template …Generate a vanilla structure or feature at a position (great for testing).
/setblock <pos> <block> [destroy|keep|replace]Place a single block.
/loot <give|insert|spawn|replace> …Roll a loot table into inventory, a chest, or the world.
/item replace|modify …Put items into slots (players, armor stands, chests). Replaces old /replaceitem.
/spreadplayers <x> <z> <spreadDistance> <maxRange> <respectTeams> <targets>Scatter players randomly on the map (UHC / event starts).
/particle <name> <pos> [delta] [speed] [count]Spawn particles for effects and map juice.
/playsound <sound> <source> <targets> [pos] [volume] [pitch]Play a sound to players.
/ride <target> <mount|dismount> …Make one entity ride another (Happy Ghast, boats, custom mounts).
/damage <target> <amount> [damageType] [at|by …]Deal exact damage for testing farms, armor, and PvP setups.
Execute, scoreboards, titles, teams, and bossbars.
/execute <…subcommands…> run <command>The power tool: change dimension, position, conditions, then run another command.
Chain: as → at → if/unless → run. Tab-complete is your friend.
/scoreboard objectives … · /scoreboard players …Track stats, money systems, minigame scores, and triggers.
/team <add|remove|join|leave|modify|list|empty> …Friendly fire, nametag colors, and collision rules for PvP/minigames.
Since 26.2, colors like darkpurple or DarkPurple fail — use dark_purple (same as text component names).
/waypoint list · /waypoint modify <targets> color|style …Manage locator-bar waypoints (player/mob dots). Colors follow the same underscore rules as teams in 26.2.
/tag <targets> <add|remove|list> [name]Label entities for selectors like @e[tag=boss].
/tellraw <targets> <json>Rich chat messages with colors, click events, and hover text.
/title <targets> <title|subtitle|actionbar> <json>Big on-screen text for events and maps.
/bossbar add <id> <name>Custom bars at the top of the screen (timers, bosses, events).
/spectate [target] [player]Force a spectator to follow an entity (replay cams, death cams).
/forceload <add|remove|query> …Keep chunks loaded without players nearby (farms, redstone).
/data get|merge|modify|remove …Read or edit NBT on blocks, entities, and storage.
/function <namespace:path>Run a .mcfunction from a datapack (many commands at once).
/tick <query|rate|step|freeze|unfreeze|sprint>Control game tick rate for debugging farms and redstone (1.20.3+).
Ops, whitelist, bans — multiplayer essentials.
/op <player> · /deop <player>Grant or revoke operator permissions.
/whitelist <on|off|add|remove|list|reload>Restrict who can join.
/ban <player> [reason] · /pardon <player>Kick permanently or reverse a ban.
/kick <player> [reason]Remove a player from the server without banning.
/list [uuids]Show who is online.
/defaultgamemode <mode>Mode new players get when they join.
/save-all · /stopFlush world save or shut down the server safely.
/say <message> · /tell <player> <message>Broadcast or whisper.
Pause → Open to LAN → Allow Cheats: ON → Start LAN World. Cheats stay on for that session. For a permanent fix, use an NBT editor on level.dat or recreate with cheats on. On servers, you need OP (/op yourname in the console).
@p = nearest player, @a = all players, @s = the entity running the command (usually you), @e = all entities (mobs, items, players…), @r = random player. Add filters like @e[type=zombie,distance=..20].
On Java 1.20.5+, item NBT like {Enchantments:[…]} was replaced by item components in square brackets, e.g. /give @s diamond_sword[enchantments={levels:{sharpness:5}}]. Old brace syntax is for entity/block data, not modern /give.
Use /locate structure minecraft:stronghold or /locate structure minecraft:fortress. Click the coordinates in chat to suggest a /tp. Biomes use /locate biome minecraft:desert (not the old /locatebiome).
Use execute’s dimension subcommand: /execute in minecraft:the_nether run tp @s ~ 100 ~ or /execute in minecraft:the_end run tp @s 0 100 0. Same X/Z scale as the Overworld unless you convert coords yourself.
Regions larger than 32,768 blocks fail. Shrink the box, or fill in chunks. You also need permission (cheats/OP) and valid block IDs (stone, not Stone).
Many names match, but syntax, selectors, and item components differ. This guide is Java Edition only. Bedrock often uses different /give format and lacks some execute features.
Run /gamerule keepInventory true. It applies to the whole world/server until you set it false again.
Hold the item and run /enchant @s sharpness 5 (or efficiency, mending, fortune, etc.). Levels cap at vanilla maxima. For custom/overpowered enchants use /give with enchantments={levels:{…}}.
/clear @s empties everything. /clear @s diamond removes only diamonds. Add a number at the end to limit how many are taken.
/spawnpoint @s sets your personal bed-like spawn. /setworldspawn sets where new players and players without a bed appear.
No — those come from plugins (Spigot/Paper) or datapacks. Vanilla alternatives: /spawnpoint, /setworldspawn, /tp to saved coords, or a datapack that adds homes.
Your ultimate resource for Minecraft tools and guides.
We also run a Fortnite tools site — free calculators, weapon guides, map drops, and season helpers.
Visit FortniteTools.com© 2026 CraftMC. All rights reserved. Also check out our Fortnite tools site.