Minecraft Command List
Minecraft command list with one-click copying: keep inventory after dying, Creative Mode, permanent daytime, clear weather, no explosions, teleporting, getting a Command Block, max-level enchantments, permanent Night Vision, invincibility, and more. Automatically uses the correct syntax for the selected version (1.14–26.3).
Commands below use the Minecraft Java 26.3 syntax for Minecraft Java {label} (switch versions in the top-right corner). Click “Copy” and paste it into Chat or a command block.
Useful Survival Commands
Keep Inventory on Death
All Game Rules ›/gamerule keep_inventory trueKeep your inventory and experience when you die. Set this to false to disable it.
/gamerule keepInventory trueCreative Mode Command
/gamemode creativeSurvival Mode is survival, Adventure Mode is adventure, and Spectator Mode is spectator.
Survival Mode Command
/gamemode survivalDaytime Forever Command
/time set day/gamerule advance_time falseThe first command sets the time to day; the second stops time from advancing.
/time set day /gamerule doDaylightCycle falseClear Weather Forever Command (Stop Rain)
/weather clear/gamerule advance_weather false/weather clear /gamerule doWeatherCycle falseDisable Creeper Explosions (Creepers Won't Damage Blocks)
/gamerule mob_griefing falseWhen disabled, mobs can't break blocks, and villagers can't harvest crops. TNT will still explode.
/gamerule mobGriefing falsePeaceful Difficulty Command
/difficulty peacefulOther difficulties: easy, normal, and hard.
Respawn Immediately After Dying
/gamerule immediate_respawn true/gamerule doImmediateRespawn trueSkip the Night When One Player Sleeps
/gamerule players_sleeping_percentage 0/gamerule playersSleepingPercentage 0Disable Natural Mob Spawning
/gamerule spawn_mobs false/gamerule doMobSpawning falseSet Your Own Spawn Point
/spawnpoint @s ~ ~ ~Use /setworldspawn to set the world spawn point.
Suicide Command
/kill @sTeleport Commands
Teleport to Coordinates
Teleport Command Generator ›/tp @s 0 100 0Teleport to a Player
/tp @s SteveReplace Steve with a player's name.
Teleport All Players to You
/tp @a @sTeleport to the Nether
/execute in the_nether run tp @s 0 70 0Teleport to The End
/execute in the_end run tp @s 100 50 0Return to the Overworld
/execute in overworld run tp @s 0 100 0Give Item Commands
Get a Command Block
Blocks with Data ›/give @s command_blockOn a server, you also need to set enable-command-block=true in server.properties.
A Stack of Diamonds
/give @s diamond 64Fully Enchanted Diamond Sword
Item Generator ›/give @s diamond_sword[enchantments={sharpness:5,looting:3,fire_aspect:2,knockback:2,unbreaking:3,mending:1}]/give @s diamond_sword[enchantments={levels:{sharpness:5,looting:3,fire_aspect:2,knockback:2,unbreaking:3,mending:1}}]/give @s diamond_sword{Enchantments:[{id:"minecraft:sharpness",lvl:5s},{id:"minecraft:looting",lvl:3s},{id:"minecraft:fire_aspect",lvl:2s},{id:"minecraft:knockback",lvl:2s},{id:"minecraft:unbreaking",lvl:3s},{id:"minecraft:mending",lvl:1s}]}Fully Enchanted Netherite Pickaxe
All Enchantment Commands ›/give @s netherite_pickaxe[enchantments={efficiency:5,fortune:3,unbreaking:3,mending:1}]/give @s netherite_pickaxe[enchantments={levels:{efficiency:5,fortune:3,unbreaking:3,mending:1}}]/give @s netherite_pickaxe{Enchantments:[{id:"minecraft:efficiency",lvl:5s},{id:"minecraft:fortune",lvl:3s},{id:"minecraft:unbreaking",lvl:3s},{id:"minecraft:mending",lvl:1s}]}Unbreakable Diamond Sword
/give @s diamond_sword[unbreakable={}]/give @s diamond_sword{Unbreakable:1b}Enchanted Golden Apple
/give @s enchanted_golden_apple 64Elytra
/give @s elytraBarrier, Structure Block, Debug Stick
/give @s barrier/give @s structure_block/give @s debug_stickLight Block
/give @s lightAdd 100 Levels
/xp add @s 100 levelsEffect Commands
Night Vision Forever
Effect Command Generator ›/effect give @s night_vision infinite 0 true/effect give @s night_vision 1000000 0 trueInvincibility Command
/effect give @s resistance infinite 4 true/effect give @s regeneration infinite 4 true/effect give @s saturation infinite 0 trueResistance V grants immunity to most damage (except The Void and /kill).
/effect give @s resistance 1000000 4 true /effect give @s regeneration 1000000 4 true /effect give @s saturation 1000000 0 truePermanent Haste (mine faster)
/effect give @s haste infinite 1 true/effect give @s haste 1000000 1 trueSpeed and Jump Boost
/effect give @s speed infinite 1 true/effect give @s jump_boost infinite 1 true/effect give @s speed 1000000 1 true /effect give @s jump_boost 1000000 1 trueClear all effects
/effect clear @sWorld and Mobs
Find the Nearest Village
/locate structure #village/locate #village/locate village/locate VillageFind a Biome
/locate biome jungleReplace `jungle` with the biome you want to find.
/locatebiome jungleView World Seed
/seedRemove dropped items
/kill @e[type=item]Remove Nearby Zombies
/kill @e[type=zombie,distance=..50]Replace `zombie` with the mob you want to remove. `distance=..50` means within 50 blocks.
Summon Lightning
/summon lightning_bolt ~ ~ ~Summon the Wither
Summon Command Generator ›/summon wither ~ ~ ~Summon an Immobile Villager
/summon villager ~ ~ ~ {NoAI:1b,Invulnerable:1b,PersistenceRequired:1b}Clear Nearby Blocks
Block Command Generator ›/fill ~-5 ~ ~-5 ~5 ~5 ~5 airServer Management
Give a Player Operator Permissions
/op SteveUse `/deop Steve` to revoke them.
Kick and Ban Players
/kick Steve/ban SteveUse `/pardon Steve` to unban them.
Whitelist
/whitelist on/whitelist add SteveServer-Wide Announcement (Colored Text)
tellraw Command Generator ›/tellraw @a ["",{text:"[公告] ",color:"gold",bold:true},{text:"服务器将在 5 分钟后重启",color:"yellow"}]/tellraw @a ["",{"text":"[公告] ","color":"gold","bold":true},{"text":"服务器将在 5 分钟后重启","color":"yellow"}]Show a Large Title in the Center of the Screen
title Command Generator ›/title @a title {text:"欢迎来到服务器",color:"aqua"}/title @a title {"text":"欢迎来到服务器","color":"aqua"}This page collects the most commonly used Minecraft commands. Each one is ready to copy and uses the correct syntax for the version selected in the top-right corner. Syntax for other versions is also listed below each command. For example, to keep items on death, versions 1.21.11 and later use /gamerule keep_inventory true, while earlier versions use /gamerule keepInventory true。
Frequently Asked Questions
What should I do if a command returns “Unknown or incomplete command”?
First, check that you have permission: in singleplayer, enable “Allow Cheats” when creating the world (or temporarily enable it using “Open to LAN” in an existing world). On a server, you need operator (OP) permissions. Then check the version: select your game version in the top right before copying the command. Many online guides show outdated syntax that causes errors in newer versions.
What are Minecraft cheat codes?
Minecraft doesn't have traditional cheat codes; what people call “cheat codes” are these commands. Enable cheats (Allow Cheats or OP permissions), then enter a command in chat.
What are the Creative Mode and Survival Mode commands?
Creative Mode /gamemode creative, Survival Mode /gamemode survival, Adventure Mode /gamemode adventure, Spectator Mode /gamemode spectator. Since 1.13, you can no longer use numbers (such as /gamemode 1).
Do these commands work in Bedrock Edition (mobile)?
This page shows the Java Edition (PC) syntax. Most basic commands in Bedrock Edition (mobile), such as `gamemode`, `time`, `weather`, `tp`, and `give` for normal items, are the same, but game rule names, item data, and enchantment syntax differ.
What if the command you need isn't here?
UseAll Commands Generatorto build any vanilla command step by step, or use AI Command Generatorto describe what you want in plain words.