Use these Minecraft commands to get free XP, control the weather, and much more
Want to learn how to use Minecraft commands and cheats?The Minecraft console is every bit as creative a tool as Minecraft itself. With it, you can teleport to various locations, change the time or weather, spawn items or entities, chat with your friends, or control entireMinecraft serversfilled with players.
Our Minecraft commands list is fully up-to-date with Minecraft 1.21, and will walk you through a selection of the most useful and powerful console commands and cheats in the game.
How to use Minecraft commands and cheats
To use a Minecraft command or cheat, all you need to do is hop into your Minecraft game andtap the “/” key to open up the console. Every command in Minecraft must start with a “/”, but using this shortcut will automatically add the “/” prefix so you can just start typing the command you want to use. Keep in mind that Minecraft commands are case-sensitive, so no capital letters allowed.
Below we’ll go over the most useful Minecraft commands and cheats and each one’ssyntax- also known as the arrangement of each attribute in the command. As you type the syntax, the Minecraft console will suggest which attribute to insert next, so don’t worry if you’re a bit lost at first.
Following our list of commands, we’ll provide an explainer onargumentsandtargets, which are bits of information included in the command syntax. Note that arguments for the commands on this list have been surrounded by either{angle brackets}or[square brackets]. Angle brackets mean that typing out the argument isrequired, while square brackets mean that the argument isoptional.
Now let’s go over some of the most commonly used and useful Minecraft commands for any player learning to use the Minecraft console.
The “help” command displays an extensive list of all console commands. You can also type the name of another command along with “help” to receive information on how to use that specific command.
Syntax:/help [command]
Example:/help timedisplays a list of the various console commands you can enter that relate to time, which we’ll delve into further below.
The “gamemode” command sets the game mode of the specified player. This command will come in handy if you’re a server owner and want to specifically change a player’s game mode from Survival to Creative to Adventure, for instance.
Syntax:/gamemode {mode} [player]
Example:/gamemode survival Olliechanges the Minecraft game mode of the player named Ollie to Survival.
The “tp” command teleports the specified entity or entities to the specified destination. It’s shorthand for the identical “teleport” command, and very useful for getting back to yourcastleortowersafter a spot of adventuring. If you’re looking for more information on how to specify who you want to teleport, see our explanation ontargetsbelow.
Syntax:
Example:/tp Ollie 300 120 300teleports Ollie to the coordinates X=300 Y=120 Z=300.
The “time” command allows you to check or change the time - from day, to noon, to night, to midnight. This can be very handy if you’re deliberately hoping to farm some mobs that only appear at specific hours.
Syntax:/time {add|query|set} {value}
Example:/time set nightwill immediately change the in-game time to night.
The “weather” command sets the weather - from rain to clear to thunder. This is a useful command if you don’t want to deal with an annoying spot of constant rain in your Minecraft world, or if you’re checking what weather effects look like with differentMinecraft shaders.
Syntax:/weather {clear|rain|thunder} [duration]
Example:/weather rain 5swill make rain fall for five seconds.
The “give” command gives an item to a player. This is an obviously vital command if you’re building an expansiveMinecraft housewith a friend and need to hand off some items in your inventory in a jiffy.
Syntax:/give {player} {item} [count]
Example:/give Ollie diamond 5will give Ollie five Diamonds. By the way, we have a full guide onhow to get Diamonds in Minecraft.
The “summon” command summons the specified entity orMinecraft mobat the specified position. Ever wanted to try a newly crafted weapon against a particular creature? This is the right command to use.
Syntax:/summon {entity} [position] [NBT data tag]
Example:/summon zombie 300 120 300will summon a zombie to the specified coordinates.
The “kill” command instantly kills the specified entity or entities. This is handy if you want to clear a particularly nasty mob from your game, or perhaps you’re testing things out in Creative mode and want to destroy the entity you just summoned. Once again, for more information on killing specific targets, refer to our explanation ontargetsbelow.
Syntax:/kill {targets}
Example:/kill @e[type=zombie]will instantly kill all zombies in the game.
The “locate” command locates the closest biome, point of interest, or structure of a specified type. This is very useful for finding specific locations likeMinecraft Villages, or biomes containing valuable resources that you’re seeking to harvest.
Syntax:/locate {structureType}
Example:/locate biome cherry_grovetells you the location of the nearest Cherry Grove biome.
The “enchant” commandenchantswhatever item a player is currently holding. Whether you’re experimenting with Minecraft’s wide range of enchantment effects or simply want to cheat your way towards a more durable weapon, this is a fun command to experiment with.
Syntax:/enchant {player} {enchantment ID} [level]
Example:/enchant Ollie sharpnesscasts the Sharpness enchantment on whatever weapon Ollie is currently holding - for instance a Diamond Sword.
The “xp” command adds, sets, removes, or checks a player’s XP. The XP command is shorthand for the /experience command and can be useful for checking your current level or for levelling up quickly if you just can’t be bothered with the Minecraft grind.
Syntax:
Example:/xp add Ollie 5 levelsinstantly gives Ollie 5 experience levels. How convenient!
Interested in playing with these commands in some new worlds? Check out ourbest Minecraft seedslist for a host of great spawn locations!
Many commands make use ofarguments, which are bits of information that come after the command itself. For example, with the command:
/gamemode creative
The command is “/gamemode”, and the argument is “creative”, which means you are telling the game to set your gamemode to Creative Mode.
Some arguments in Minecraft commands are calledtargets.These arguments tell the game who (or what) you want the command to target. The following are target arguments:
So for example, the command:
/gamemode creative @a
will set the game mode ofevery playeron the server to Creative Mode, whereas:
/gamemode creative @r
will set the game mode ofa random playeron the server to Creative Mode.