← All Courses

Minecraft Coding: Command Your World

Free   6 lessons

Lesson 1: The Command Console — Your Superpower

The Command Console — Your Superpower

Most players never touch the command console. That's like having a sports car and only ever walking. Commands give you abilities that normal gameplay doesn't — and learning them teaches you how real programming works.

Opening the Console

Java Edition: Press the / key or T to open chat, then type /

Bedrock Edition: Press T or tap the chat icon, then type /

You need to be in a world where cheats are enabled. When creating a new world, turn on "Allow Cheats" or "Cheats". On existing worlds: pause → Open to LAN → Allow Cheats ON.

Your First Commands

Try these right now:

/time set day

Instantly makes it daytime.

/time set night

Instantly night.

/weather clear

Stops rain and storms.

/weather thunder

Starts a thunderstorm.

/gamemode creative

Switches you to creative mode.

/gamemode survival

Back to survival.

How Commands Are Structured

Every command follows a pattern. Understanding the pattern means you can figure out new commands on your own.

/commandname argument1 argument2 argument3

  • The command name tells Minecraft what to do
  • Arguments are the details — who, what, where, how much
  • Arguments are separated by spaces
  • Some arguments are required, some are optional

This is exactly how functions work in real programming languages. A function name followed by parameters. You're already learning to code.

Target Selectors — The Secret Weapon

Many commands need to know who to affect. Instead of typing your username every time, you can use selectors:

  • @p — the nearest player (usually you)
  • @s — yourself specifically
  • @a — all players
  • @e — all entities (players, mobs, items)
  • @r — a random player

Example:

/kill @e

Kills every entity in the world. Be careful with that one.

/effect give @p speed 30 2

Gives the nearest player Speed II for 30 seconds.

Getting Help

Type /help to see a list of commands. Type /help fill to see how the fill command works. Minecraft's built-in help is like documentation — exactly what programmers read when learning new tools.

Practice Challenges

  1. Give yourself a full set of diamond armor using /give
  2. Set the time to noon (time value: 6000)
  3. Give all players 64 golden apples
  4. Look up the /effect command and give yourself night vision