Every Minecraft command worth copy-pasting — give, teleport, time, weather, effects, gamerules and more — plus how to turn cheats on (including the Open-to-LAN trick for survival worlds). Java Edition. Search, copy, paste.
Open chat with T (or /) and type a command — they all start with a slash.
Commands need cheats on: play in Creative, make a world with Allow Cheats: On, or be a server operator.
Survival cheat trick: pause → Open to LAN → set Allow Cheats: On → Start LAN World. Cheats work for that session — nobody else needs to join.
@p nearest player, @a all, @e entities, @s yourself. Coordinates: ~ = relative to you, ^ = relative to where you're facing. Server-only commands (op, ban, kick, whitelist) won't run in single-player. Game-rule names below are camelCase (Java 1.21.0–1.21.10); the newest snapshots renamed them to snake_case (e.g. keep_inventory).Type to filter, hit Copy, paste in-game. 38 commands. Placeholders in [brackets] are values you fill in.
| Command | What it does | Category |
|---|---|---|
| /gamemode [survival/creative/adventure/spectator] [player] | Set a player's game mode (omit player to set your own). | Player |
| /effect give [targets] [effect] [seconds] [amplifier] | Apply a status effect — e.g. /effect give @s minecraft:night_vision infinite 0 true. | Player |
| /effect clear [targets] [effect] | Remove one or all status effects. | Player |
| /xp add [targets] [amount] [levels/points] | Add experience (alias /experience). Negative subtracts. | Player |
| /kill [targets] | Kill entities — /kill @e[type=!player] clears all mobs/items. | Player |
| /spawnpoint [targets] [pos] | Set a player's personal respawn point. | Player |
| /give [targets] [item] [count] | Give an item — e.g. /give @p minecraft:diamond_sword[enchantments={"minecraft:sharpness":5}]. (1.20.5+ uses [components], not NBT.) | Items / Inventory |
| /enchant [targets] [enchantment] [level] | Enchant the held item — e.g. /enchant @s minecraft:mending 1. | Items / Inventory |
| /clear [targets] [item] [maxCount] | Clear items from inventory (no args clears everything). | Items / Inventory |
| /time set [day/night/noon/midnight/ticks] | Set the time (day=1000, noon=6000, night=13000, midnight=18000). | World / Time / Weather |
| /weather [clear/rain/thunder] [duration] | Set the weather. | World / Time / Weather |
| /difficulty [peaceful/easy/normal/hard] | Set difficulty (no arg shows the current one). | World / Time / Weather |
| /setworldspawn [pos] | Set the global world spawn point. | World / Time / Weather |
| /gamerule keepInventory true | Keep your items and XP when you die. | Game Rules |
| /gamerule doDaylightCycle false | Freeze the day/night cycle (stops time). | Game Rules |
| /gamerule doWeatherCycle false | Stop weather from changing on its own. | Game Rules |
| /gamerule mobGriefing false | Stop mobs altering blocks (creeper craters, endermen, etc.). | Game Rules |
| /gamerule doMobSpawning false | Turn off natural mob spawning. | Game Rules |
| /gamerule doImmediateRespawn true | Skip the death screen and respawn instantly. | Game Rules |
| /gamerule randomTickSpeed [n] | Crop growth / fire spread / leaf decay speed (default 3). | Game Rules |
| /tp [target] [destination] | Teleport to an entity or player (alias /teleport). | Teleport |
| /tp [x] [y] [z] | Teleport to coordinates — e.g. /tp 100 64 -200 or /tp ~ ~10 ~. | Teleport |
| /tp [targets] [x] [y] [z] [yaw] [pitch] | Teleport a target to coordinates with optional facing. | Teleport |
| /summon [entity] [pos] [nbt] | Spawn an entity — e.g. /summon minecraft:zombie ~ ~ ~ {IsBaby:true}. | Spawn / Blocks |
| /setblock [pos] [block] [destroy/keep/replace] | Place a single block — e.g. /setblock ~ ~1 ~ minecraft:chest[facing=east]. | Spawn / Blocks |
| /fill [from] [to] [block] [mode] [replace filter] | Fill a cuboid region with a block. | Spawn / Blocks |
| /clone [begin] [end] [destination] [mode] | Copy a region of blocks to a new location. | Spawn / Blocks |
| /op [targets] | Grant operator status. | Admin / Server (multiplayer) |
| /deop [targets] | Revoke operator status. | Admin / Server (multiplayer) |
| /kick [targets] [reason] | Disconnect a player. | Admin / Server (multiplayer) |
| /ban [targets] [reason] | Ban a player (and /pardon to unban). Java only. | Admin / Server (multiplayer) |
| /whitelist [add/remove] [targets] | Add or remove a player from the whitelist. | Admin / Server (multiplayer) |
| /say [message] | Broadcast a message to everyone. | Admin / Server (multiplayer) |
| /seed | Show the world seed. | Info / Find |
| /locate structure [structure] | Find the nearest structure — e.g. /locate structure minecraft:village_plains. | Info / Find |
| /locate biome [biome] | Find the nearest biome. | Info / Find |
| /tellraw [targets] [json] | Send a formatted message — e.g. /tellraw @a {"text":"Hi","color":"green"}. | Info / Find |
| /title [targets] title [json] | Show big centered title text (subtitle/actionbar also). | Info / Find |
/gamerule keepInventory true — you keep your items and XP when you die. (On the newest snapshots it's /gamerule keep_inventory true.)/give [player] [item] [count] — e.g. /give @p minecraft:netherite_pickaxe. Since 1.20.5, enchantments/data use square-bracket [components]./tp [x] [y] [z] for coordinates (~ means relative to you), or /tp [player] to jump to someone. /teleport is the same command.Console open? Here's the rest of the toolkit.