Home/ Guides/ Minecraft Commands
⛏️ Minecraft · Commands

Minecraft Commands

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.

Verified vs. the official Minecraft Wiki · Java Edition 1.21.x · June 2026
Open the console
Open chat and type / commands in a Creative or cheats-on world. In Survival, use Open to LAN → Allow Cheats: On to switch them on.
Full command list ↓ — 38 commands, searchable, one-tap copy.
🔛

How to Enable Commands & Cheats in Minecraft

1

Open chat with T (or /) and type a command — they all start with a slash.

2

Commands need cheats on: play in Creative, make a world with Allow Cheats: On, or be a server operator.

3

Survival cheat trick: pause → Open to LAN → set Allow Cheats: On → Start LAN World. Cheats work for that session — nobody else needs to join.

Target selectors fill in for player names: @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).
⌨️

Minecraft Command List

Type to filter, hit Copy, paste in-game. 38 commands. Placeholders in [brackets] are values you fill in.

CommandWhat it doesCategory
/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 trueKeep your items and XP when you die.Game Rules
/gamerule doDaylightCycle falseFreeze the day/night cycle (stops time).Game Rules
/gamerule doWeatherCycle falseStop weather from changing on its own.Game Rules
/gamerule mobGriefing falseStop mobs altering blocks (creeper craters, endermen, etc.).Game Rules
/gamerule doMobSpawning falseTurn off natural mob spawning.Game Rules
/gamerule doImmediateRespawn trueSkip 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)
/seedShow 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

Minecraft Commands FAQ

How do you turn on cheats in Minecraft?
Play in Creative or a world with Allow Cheats on. To enable cheats in an existing Survival world, pause → Open to LANAllow Cheats: On → Start LAN World (no one else has to join). It lasts for that session.
What's the keep inventory command in Minecraft?
/gamerule keepInventory true — you keep your items and XP when you die. (On the newest snapshots it's /gamerule keep_inventory true.)
How do you give yourself items in Minecraft?
/give [player] [item] [count] — e.g. /give @p minecraft:netherite_pickaxe. Since 1.20.5, enchantments/data use square-bracket [components].
How do you teleport in Minecraft?
/tp [x] [y] [z] for coordinates (~ means relative to you), or /tp [player] to jump to someone. /teleport is the same command.

More from GamesOMG

Console open? Here's the rest of the toolkit.