← Back to the map
Lesson 2

🧭 Coordinates & the World

Coordinates & the World illustration

Remember the x and ynumbers from the last lab? πŸ€” Those were the hero's coordinates β€” its address in the game world.

Minecraft knows where every single block, mob, and player is standing. How does it keep track of a whole giant world? Let's find out β€” and it's simpler than you think.

1

The big idea: the world is a giant grid

Imagine the game world as a giant sheet of graph paper. Every square has an address made of two numbers:

  • x β€” how far across (left to right) β†’
  • y β€” how far up or down ↓

We write an address like (x, y) β€” for example (3, 5) means β€œ3 across, 5 down”. The corner where counting starts, (0, 0), is called the origin. That's it β€” that's the whole idea behind how a game remembers where everything is.

2

Your turn: explore the grid world

Here's a little block world. Drag the hero and watch its (x, y) change. Click squares to build with blocks. Hoveranywhere to read that square's address. Try to feel how every spot is just two numbers.

Drag the red hero around. Click empty squares to place or remove blocks. Watch the numbers change!

πŸ“ Where is the hero?

x (across)
4
,
y (down)
2
hover a square to see its address
πŸš€ Teleport (like /tp)
blocks placed: 0
3

Discovery missions

Try each one in the world above, tick it off, then peek at the secret.

0/5
  • 🏠Drag your hero into the very top-left square. What are its numbers?

  • ➑️Drag the hero straight to the RIGHT. Which number changes β€” x or y?

  • ⬇️Now drag straight DOWN. Does y get bigger or smaller?

  • 🧱Place 3 blocks, then hover over each one. What does every block have?

  • πŸš€Use Teleport: type x = 10, y = 2, and press Go!

🧱 Wait β€” Minecraft is 3D!

Our grid uses two numbers because the screen is flat. But you can walk around inside Minecraft, so it needs a third number for depth: z. So every block lives at (x, y, z) β€” across, up, and how far in. Press F3in Minecraft sometime and you'll see your very own x, y, z ticking away. Same idea β€” just one more number. 😎

🌟 You leveled up! You now know:

🎬 Behind the scenes β€” what's next?

Now your game knows where everything is. But what happens when two of those things end up in the same spot β€” when your hero lands on a platform, or touches a coin? Right now they'd just slide straight through each other like ghosts! πŸ‘» Next, we teach the game to notice the exact moment things touch. πŸ‘‡

πŸ’₯Next stop Β· Lesson 3Collisions & Hitboxes β†’Coins, platforms, bonks β€” how the game knows the exact moment two things touch.
← Back to the map