Minecraft Modding For Kids For Dummies
Book image
Explore Book Buy On Amazon

A Missing badge has nearly completed code that is missing only a few blocks. Your Minecraft challenge? To figure out which blocks are missing and where to place them. Without those missing blocks, the mod cannot run.

As with a Scramble badge, you use a smart strategy to earn a Missing badge. Follow these steps:

  1. Identify how many blocks are missing, and identify where they’re missing.

    Start thinking about what type of blocks might be missing, such as a text block.

  2. Test the correct version of the code in the simulator (by clicking the blue Test button) or Minecraft (by clicking the orange Test button) to see what it’s supposed to do.

  3. Follow the code as it’s running, and identify where the missing blocks should be placed.

  4. Add in the blocks that are missing, and test your code to see whether it accomplishes the same result as the correct version does in Step 1 of this list.

    This is what professional coders do: They follow their code while they’re testing it, to ensure that they have told the computer to do the right thing.

Trace code

Coders make mistakes, and communicating with computers can be tricky.

Coders (like you) should be sure to follow the code, before and while it’s running, to ensure that you put the lines of code in the correct order.

Tracing code is an important skill to master, and you can do it in multiple ways. Here are two helpful code tracing strategies:

  • Use the computer. Especially for Missing badges, this is a great way to trace code. First, run your code (or the correct version) and watch what happens. Then run the code again, but this time point to each line of code as it’s being run. For example, when you see the Hello, World! message, point to the line of code. Then you can figure out what is happening in the correct code when your code has a missing block.

  • Use pencil and paper. If you have a written mod that isn’t working the way you expect, draw on paper what is happening after each line of code executes. For example, the code Send Message Hello, World! to me will be printed to the screen, so you should write it down on paper.

    image0.jpg

Earn the Saying Hello badge: Missing Edition

Open the Saying Hello (Missing) challenge by clicking on the badge. When you earn the badge, the code makes part of the lyrics to a Cat Stevens song print to the screen.

image1.jpg

Three blocks are missing from this mod. The first is probably a player block because that’s the only player you have used and that’s what the other ones are using. The last two are likely to be text blocks because that’s the only kind of message you have sent, and the first two are sending text messages too. It’s impossible to guess what text should be placed in the text blocks, because the list of possibilities is very, very large.

To complete a missing badge, follow these steps:

  1. Run the correct version in Minecraft or the simulator and watch what happens. When you run your code, you should see this scene.

    image2.jpg

    The first line of code sends the message How can I try to explain? but doesn’t specify which player is the target of the message (the one that will receive the message). After running the code, you can see that the target should be the me block because you can see that message when you run the correct version and the last two messages are

    It has always been the same,
    same old story . . .

    Everything sent to me shows up on the screen of the person who ran the mod. So, if you run the mod and you see the message, the target of the message was me.

  2. Add in the me block and the two text blocks with the correct messages in them. Then test your mod, to be sure that it does the same thing as the correct version does.

    image3.jpg

If you return to a Missing badge or Scramble badge after completing it, the LearnToMod software asks whether you want to reset the code so that it’s missing or scrambled again. If you choose to reset your badge, you will still have the badge. You just get to attempt the challenge again.

About This Article

This article is from the book:

About the book authors:

Sarah Guthals, Ph.D. is the CTO of ThoughtSTEM and has dedicated her life to coding education.

Stephen Foster, Ph.D. is the CEO of ThoughtSTEM, a company that teaches computer science to kids across America.

Lindsey Handley, Ph.D. is the COO of ThoughtSTEM and has hundreds of hours of experience as a classroom instructor for Minecraft based science and computer science classes.

This article can be found in the category: