
Looking to expand your minecraft game? Commands are the way to do it! Note that in order to use commands in a world, you have to turn them on when creating the world.
Tips & Basics
How to allow cheats: When creating a world, select ‘more options’ then toggle “Allow Cheats?” to yes. Unfortunately they cannot later be turned on if you choose no.
To use a command, pull up the chat bar, then type /. The button used to pull up chat will be different per console. After the /, don’t add a space, but type the command you want to use (for example, /weather), and follow the formats listed below to create the command you want to use.
To get a command block, use the /give command as shown below under the Item category. This is the only way to get command blocks.
To use a command block, simply place the command block, click or tap to open its menu, and type in the command you want it to use when activated, just like if you were using the command yourself. For example, a command block could have /give @p diamond_sword. Add a redstone setup (a simple button or pressure plate will do), and when the command block is activated, it will give @p a diamond sword! Easy peasy. Each command block can only carry out one command, but you can line several up, connect them with redstone, and there you go, problem solved.
Target players: Some commands target certain players. If this is the case you can either put @TheirEntireUsername or you can just use these shortcuts!:
- @p = Nearest player
- @r = Random player
- @a = All players
- @e = All entities
- @s = The entity executing the command / yourself
How to see world stats: Hit the F3 key on PC to see helpful stats such as coordinates. Hit F3 again to make all the words go away π Within all these words, coordinates can be found near the bottom left.
Coordinates come in X Y Z, where X is north/south, Y is up/down, and Z is east/west.
Commands
Generic
- Help
- /help [CommandName]
- Example: /help weather
- Use this command to learn more about other commands or how to use them.
- Gamemode
- /gamemode [adventure/creative/spectator/survival]
- Example: /gamemode adventure
- Switch the gamemode to adventure (look but don’t touch), creative (unlimited flying, resources, health, etc.), spectator (ghost mode), or survival (death and virtual labor),
- Difficulty
- /difficulty [peaceful/easy/normal/hard]
- Example: /difficulty peaceful
- Switch the difficult to peaceful (no losing health, no monsters) or any of the other difficulty settings.
Player
- EXP
- /xp [amount] [player]
- Example: /xp 300 batman300
- You can also do levels instead: /xp [amount]L [player]
- Example: /xp 5L @s
- Use this command to give yourself or others EXP or levels automatically. Great for adventure maps?
- Teleport
- /tp [player] [x] [y] [z]
- Example: /tp @p 300 10 87
- Use this to teleport you or other players instantly to other locations. Be careful that the y coordinate isn’t too high (or you’ll fall to your doom) or too low (or you’ll suffocate in a block)…
- Player Damage (different types)
- /gamerule <drowningDamage/fireDamage/fallDamage> <true/false>
Screen Text
- Text appearing as Chat Message
- /tellraw [player] {text and descriptors}
- { } must be included. Within the { }, add:
- “text”:”what you want to say” (Example: “text”:”I like pie”)
- “bold”:true (if you want your text to be bold. /Optional)
- “italic”:true (if you want your text to be italicized. /Optional)
- “color”:”Color_You_Want” (Example: “color”:”red”) Colors can be: red, dark_red, yellow, gold, green, dark_green, blue, dark_blue, aqua, dark_aqua, light_purple, dark_purple, gray, dark_gray, white, black. _ must be included.
- Separate items with commas (no spaces).
- Example: /tellraw @e {“text”:”Go into the room”,”bold”:true,”color”:”dark_red”}
- When executed, the example command will make “Go into the room” popup as an in-game chat message, bold printed, and dark red in color.
- Text appearing in Center of Screen
- /title [player] [title/subtitle] {text and descriptors}
- Title is larger and directly in the center, subtitle is slightly smaller and below the title.
- { } must be included. See “text appearing as chat message” to see what to add within the { } (text, bold, italic, and color).
- Example: /title @a title {“text”:”Come in!!”,”bold”:true,”color”:”dark_purple”}
- When executed, the example command will make “Come in!!” appear in the center of the screen, bold printed, and dark purple in color.
- Effect how long Titles will fade and stay on Screen
- /title [player] times [fade in ticks] [stay ticks] [fade out ticks]
- Example: /title @a times 30 100 30
- After example command is executed, all titles from here on out will take 30 ticks to fade in, stay on screen for 100 ticks, and take 30 ticks to fade out.
World
- Check Seed
- /seed
- Gives you the seed number if you want to recreate the same location map or give it to someone else.
- Set World Spawn
- /setworldspawn
- (if you want the world spawn to be where you are standing)
- You can also do a specific coordinate: /setworldspawn [x] [y] [z]
- Example: /setworldspawn 1403 110 -1140
- Use this command if you want reset the new spawn point when you die. Very helpful if you hitchhiked forever before building a house.
- Set Player Spawn
- /spawnpoint [player] [x] [y] [z]
- Example: /spawnpoint @p 300 10 87
- Or leave the coordinates out to set the spawn of where you’re standing
- Example: /spawnpoint @p
- Use this to set the spawnpoint of specific players
- Weather
- /weather [clear/rain/thunder]
- Example: /weather clear
- This command is awesome if you’re tired of laggy rain, need faster crops, or need supercharged creepers :3
- Set Time
- /time set [ticks]
- The game measures time in ticks, not hours / minutes /etc.
- 0 = Dawn
- 1000 = Morning
- 6000 = Midday
- 12000 = Dusk
- 18000 = Midnight
- Or do anywhere in between π
- Example: /time set 1000
- This command is great for bypassing long nights without a bed, sword, or torches.
- Stop Time
- /gamerule doDaylightCycle [true/false]
- Example: /gamerule doDaylightCycle false
- Use this command to stop or resume time.
Items
- Give
- /give [player] [item] [amount]
- Amount is optional. Leave it out to just get 1 of the item.
- Example: /give @p minecraft:torch 300
- Extremely helpful in any situation ever.
- Full list of item IDs
- Keep Inventory
- /gamerule keepInventory [true/false]
- Example: /gamerule keepInventory true
- Turn on and off the ability to keep all the things in your inventory when you die instead of exploding them everywhere. True means you keep the stuff, false means you don’t.
- Tile Drops
- /gamerule doTileDrops [true/false]
- Example: /gamerule doTileDrops false
- Turn on and off whether destroyed blocks will be dropped as tiles.
- Enchant
- /enchant [player] [enchantment name] level:[#]
- Example: /enchant @s knockback level:2
- Enchants the item the activator is holding
Mobs
- Summon
- /summon [EntityName] [x] [y] [z]
- Coordinates are optional. Remove them if you want the mob to spawn right in front of you.
- Example: /summon minecraft:iron_golem
- Use this command to spawn immediate help, farm animals, or foes.
- Mob Spawning
- /gamerule doMobSpawning [true/false]
- Example: /gamerule doMobSpawning false
- Turn on or off whether new mobs can spawn on their own.
- Kill
- /kill [player]
- Kills targeted player. Use @e to kill all mobs and players, including yourself.
- Mob Griefing
- /gamerule mobGriefing [true/false]
- Example: /gamerule mob Griefing false
- Turn off and on whether mobs can destroy/edit the landscape. If false, sheep can’t mow the grass, creepers will not destroy blocks when they explode, endermen can’t carry blocks around, etc.
Quick Building
- Copy and paste structures
- /clone <x1 y1 z1> <x2 y2 z2> <x y z>
- Example: /clone 100 30 4 100 34 4 150 40 4
- Select an already built structure from any corner (x1 y1 z1) to the opposite corner (x2 y2 z2), and paste it somewhere else (x y z, which will be the lower northwest corner, AKA the lower back left corner if facing north). Note that the copied structure must be facing the same direction as where you want it pasted. This will also clone chests and every item inside them. A great way to send mail?
- Fill, Replace, or Delete all blocks in an Area
- /fill <x1 y1 z1> <x2 y2 z2> <block> <replace/outline/hollow/keep/destroy> <block>
- Selects an area between on corner (x1 y1 z1) and the opposite corner (x2 y2 z2), and affects either all the blocks in that area or a specific type of block in that area.
- Replace: Example: /fill 10 10 10 15 15 15 oak_planks replace dirt
- In this case, all the dirt blocks between 10 10 10 and 15 15 15 will be replaced by oak planks.
- Outline: Example: /fill 10 10 10 15 15 15 oak_planks outline
- In this case, a hollow box made of oak planks will be created between 10 10 10 and 15 15 15, but the inside blocks that were already there will remain.
- Hollow: Example: /fill 10 10 10 15 15 15 oak_planks hollow
- In this case, a hollow box made of oak planks will be created between 10 10 10 and 15 15 15, and the inside blocks that were already there will be replaced with air.
- Keep: Example: /fill 10 10 10 15 15 15 dark_oak_planks keep
- In this case, all of the air blocks between 10 10 10 and 15 15 15 will be replaced with dark oak planks, while everything else in the selected region will remain the same.
- Destroy: Example: /fill 10 10 10 15 15 15 air destroy
- In this case, all of the blocks between 10 10 10 and 15 15 15 will be replaced with air.