1 / 12
LESSON 1 OF 12 · IRON · JAVA

WHAT ARE COMMANDS?

Commands are instructions you type in chat to control Minecraft. They do instantly what would take minutes by hand. This is the slash you’ll use everywhere.

EXAMPLE
/say Hello

📋 You can copy this exactly — it will work.

Breakdown

  • / — marks this as a command
  • say — the action
  • Hello — the message to print
TRY THIS

Type /say I learned commands in chat. Press Enter. Your message appears in yellow at the top of chat.

COMMON MISTAKE

Your “command” appears as a normal white chat message.

👉 You forgot the /.

Always start with / — e.g. /say Hello.

TIP

Press in chat to recall the last command.

LESSON 2 OF 12 · IRON · JAVA

COORDINATES (X, Y, Z)

Now that you can run a command, tell Minecraft where. Coordinates pin down an exact block — X (east-west), Y (up-down), Z (south-north).

EXAMPLE
/tp @s 0 100 0

📋 You can copy this exactly — it will work.

WHY THIS MATTERS

This is what every other command points at — once you read XYZ fluently, the rest of the course clicks into place.

Breakdown

  • /tp — teleport
  • @s — yourself
  • 0 100 0 — X (east), Y (up), Z (south)

Quick version

/tp @s ~ ~50 ~
TRY THIS

Run /tp @s 0 200 0. Press F3 — the XYZ line shows roughly 0 / 200 / 0. You're high above spawn.

COMMON MISTAKE

Teleporting drops you in lava or out of the world.

👉 Your Y is too low (sea level is 64, bedrock is −64).

Use Y = 200 to land safely in the sky.

TIP

Press F3 any time to read your live X, Y, Z.

LESSON 3 OF 12 · IRON · JAVA

RELATIVE COORDINATES (~)

Absolute coords are precise. Relative coords (~) move you from where you already are — add a number to offset.

EXAMPLE
/tp @s ~ ~10 ~
MENTAL MODEL

~ = where I am. A number after it shifts me on world axes.

Breakdown

  • ~ — keep current X
  • ~10 — current Y plus 10
  • ~ — keep current Z

Quick version

/tp @s ~ ~50 ~
TRY THIS

Run /tp @s ~ ~50 ~. You shoot straight up 50 blocks. Run it again — you go up another 50.

COMMON MISTAKE

Chat says “Expected whitespace.”

👉 You wrote ~ 10 with a space.

Write ~10 with no space.

TIP

Three plain ~ ~ ~ means “exactly where I am.” Useful default for spawning structures at your feet.

LESSON 4 OF 12 · IRON · JAVA

LOCAL COORDINATES (^)

~ follows world axes. ^ follows your facing — left, up, forward — no matter which way you look. Don’t worry if this feels weird at first — it clicks after a few tries.

EXAMPLE
/tp @s ^ ^ ^5
MENTAL MODEL

~ follows the world. ^ follows your face.

Breakdown

  • ^ — no left/right offset
  • ^ — no up/down offset
  • ^5 — 5 blocks forward

Quick version

/tp @s ^ ^ ^10
TRY THIS

Face north, run /tp @s ^ ^ ^10 — you move 10 north. Turn east, run it again — you move 10 east. Same command, new direction.

COMMON MISTAKE

The teleport behaves randomly or fails.

👉 You mixed ^ and ~ in one command.

Pick one system — all ^ or all ~.

TIP

Local coords are perfect for “dash forward” mechanics or aiming particles in front of the player.

LESSON 5 OF 12 · IRON · JAVA

TARGET SELECTORS

Coordinates pick a place; selectors pick who. Used in nearly every command.

EXAMPLE
/give @p minecraft:diamond
/give @a minecraft:diamond
MENTAL MODEL

@p nearest, @a all, @s self, @e every entity, @r random.

Breakdown

  • @p — nearest player
  • @a — all players
  • @s — self
  • @e — all entities (mobs, items, arrows…)
  • @r — a random player

Quick version

/give @a minecraft:diamond
TRY THIS

Run /give @a minecraft:diamond. Open inventory — one diamond appears. Now change @a to @r and run it again — in multiplayer, only a random player gets one.

COMMON MISTAKE

/kill @e wipes mobs, paintings, and dropped items all at once.

👉 @e means every entity, not just players.

Use @a for players, or @e[type=zombie] to filter.

TIP

Add [limit=1,sort=random] for raffles: @a[limit=1,sort=random].

YOU JUST UNLOCKED
  • Run any command on every player at once
  • Filter to nearby, self, or one random player
  • Target mobs and items with @e[type=...]
LESSON 6 OF 12 · IRON · JAVA

TIME & WEATHER

Selectors handle who; these handle the world. Skip night, kill rain, freeze the sky in seconds.

EXAMPLE
/time set day
/weather clear

Breakdown

  • /time set — set time of day
  • day — sun rises (also night, noon, midnight)
  • /weather — set weather
  • clear — sun (also rain, thunder)

Quick version

/time set day
TRY THIS

Run /time set day at night. The sun jumps up. Then /weather thunder — clouds roll in instantly.

COMMON MISTAKE

Chat says “Unknown command” on /time day.

👉 You skipped set.

Use /time set day.

TIP

Combine with /gamerule doDaylightCycle false (next lesson) to lock the sun.

LESSON 7 OF 12 · IRON · JAVA

SPAWN & RESPAWN

World commands cover when. Spawn commands cover where you start — world spawn for new players, spawnpoint for respawning.

EXAMPLE
/setworldspawn ~ ~ ~
/spawnpoint @s

Breakdown

  • /setworldspawn — set the global world spawn
  • ~ ~ ~ — use my current position
  • /spawnpoint — set my personal respawn point
  • @s — self

Quick version

/spawnpoint @s
TRY THIS

Stand somewhere fun. Run /spawnpoint @s, then /kill @s. You respawn at the spot you set.

COMMON MISTAKE

New players keep landing in the wrong spot.

👉 You set /spawnpoint (per-player) instead of /setworldspawn.

Run /setworldspawn ~ ~ ~ where new players should appear.

TIP

Sleeping in a bed sets your spawnpoint automatically — same effect, no command needed.

LESSON 8 OF 12 · IRON · JAVA

GAMERULES

Spawnpoint tweaks one player. Gamerules tweak the whole world — turning features on or off across every player and chunk.

EXAMPLE
/gamerule keepInventory true

Breakdown

  • /gamerule — change a global rule
  • keepInventory — the rule (case-sensitive)
  • true — turn it on (use false to turn off)

Quick version

/gamerule keepInventory true

Combined: lock day + clear sky + keep items

COMBINED
/time set day
/gamerule doDaylightCycle false
/gamerule keepInventory true

Three commands — permanent daylight, no item loss. Run them once at the start of any test world.

TRY THIS

Run /gamerule keepInventory true. Then /kill @s. Your inventory survives the death.

COMMON MISTAKE

A gamerule appears to do nothing.

👉 You misspelled the name — gamerule names are case-sensitive.

Type /gamerule keep and press Tab to auto-complete.

TIP

High-impact rules: doMobSpawning, mobGriefing, doFireTick, showDeathMessages.

LESSON 9 OF 12 · IRON · JAVA

GIVING ITEMS

World rules are set — now you need gear. /give spawns any item directly into a player's inventory.

EXAMPLE
/give @p minecraft:diamond 5

📋 You can copy this exactly — it will work.

Breakdown

  • /give — put items in inventory
  • @p — player to give to (nearest)
  • minecraft:diamond — the item (always namespaced)
  • 5 — how many

Quick version

/give @s minecraft:netherite_sword

Combined: arm and buff every player

COMBINED
/give @a minecraft:diamond_sword
/effect give @a minecraft:speed 60 1

/give + /effect + @a = arm and buff every player at once.

TRY THIS

Run /give @s minecraft:golden_apple 64. Open inventory — a full stack appears.

COMMON MISTAKE

Chat says “Unknown item: diamond.”

👉 You skipped the minecraft: namespace.

Use /give @p minecraft:diamond, or Tab-complete after mi.

TIP

In 1.21+, append components to enchant: ...netherite_sword[enchantments={levels:{"minecraft:sharpness":5}}].

LESSON 10 OF 12 · IRON · JAVA

EFFECTS

Items go in inventory; effects go on the player. /effect give grants temporary abilities like speed, jump boost, or night vision.

EXAMPLE
/effect give @p minecraft:speed 10 1

Breakdown

  • /effect give — apply an effect
  • @p — who gets it
  • minecraft:speed — the effect
  • 10 — duration in seconds
  • 1 — amplifier (level − 1, so 1 = Speed II)

Quick version

/effect give @s minecraft:night_vision 99999 1 true
TRY THIS

Run /effect give @s minecraft:night_vision 99999 1 true. Walk into a cave — everything looks fully lit, no swirly particles.

COMMON MISTAKE

Chat says “Unknown command” on /effect @p speed 10 1.

👉 That's Bedrock syntax.

Java needs give: /effect give @p minecraft:speed 10 1.

TIP

Trailing true hides the swirly particles — cleaner look, identical effect.

LESSON 11 OF 12 · IRON · JAVA

BASIC BUILDING COMMANDS

Effects modify the player; building commands modify the world. /fill and /setblock place blocks instantly.

EXAMPLE
/fill ~ ~ ~ ~5 ~5 ~5 minecraft:glass
/setblock ~ ~ ~ minecraft:gold_block

📋 You can copy this exactly — it will work.

Breakdown

  • /fill — fill a region with a block
  • ~ ~ ~ ~5 ~5 ~5 — two corners — here, to 5 east/up/south
  • minecraft:glass — the block
  • /setblock — place a single block

Quick version

/fill ~-2 ~ ~-2 ~2 ~4 ~2 minecraft:glass hollow

Combined: instant safe room around any player

COMBINED
/execute at @p run fill ~-2 ~ ~-2 ~2 ~4 ~2 minecraft:glass hollow

execute at @p run fill places the cube around the nearest player — wherever they are.

TRY THIS

Stand in an open area. Run the quick version. A 5-tall hollow glass cube wraps around you — instant safe room.

COMMON MISTAKE

The fill suffocates you instantly.

👉 Your corners overlapped your body and filled solid blocks.

Add hollow after the block, or /tp @s ~ ~5 ~ first.

TIP

Modes: hollow (shell), outline (frame), keep (don't replace), destroy (drop old blocks).

LESSON 12 OF 12 · IRON · JAVA

FINAL PROJECT

You've covered every basic Java command. This last lesson is the checklist for a fresh test world in 30 seconds.

EXAMPLE
/time set day
/weather clear
/gamerule keepInventory true
/give @p minecraft:diamond_sword
/effect give @p minecraft:speed 30 1

📋 You can copy this exactly — it will work.

Breakdown

  • Time set day — lock daytime
  • Weather clear — kill the rain
  • keepInventory true — no item loss on death
  • Give sword — arm yourself
  • Effect speed — Speed II for 30s

Test-world checklist

  • Daylight/time set day. Optional /gamerule doDaylightCycle false to lock it.
  • Clear sky/weather clear kills active rain or thunder.
  • Keep items/gamerule keepInventory true.
  • Loadout/give @p minecraft:diamond_sword — or any item via Tab-complete.
  • Buff/effect give @p minecraft:speed 30 1 true.
  • Spawn lock — Stand at your starting spot, run /spawnpoint @s.
TRY THIS

Save the five commands in a Notepad file. Open a fresh Creative world, paste them line by line. Time to ready: under 30 seconds.

COMMON MISTAKE

keepInventory “doesn't work” on your first death.

👉 You died before setting the rule.

Run the gamerule first, then test.

TIP

Every command from here builds on these five concepts: coords, selectors, world state, items, effects.

YOU CAN NOW
  • Spin up a fresh test world in 30 seconds
  • Target any player, mob, or entity with selectors
  • Set world rules, time, and weather on demand
  • Hand out items and effects to anyone — including everyone at once
YOU FINISHED IRON

Every command from here builds on these five concepts: coords, selectors, world state, items, effects. Emerald is where you start chaining them into systems.

You’re no longer typing commands — you’re using them.