Project 2

Earning Modding Badges

In this project, I help you grasp the basic concepts of programming, by completing challenges and earning badges. I give you the steps to earn different kinds of badges while learning about functions, and I encourage you to try writing your own mods (see the end of Project 1).

image

Write Mods with Functions

In Project 1, I describe how to write a mod that has a function named main (refer to Figure 1-27, over in Project 1). From now on, I’ll call it the main function. When you run a mod in Minecraft, your mod always starts running from the main function.

Notice that the Saying Hello badge is similar to the Write Your First Mod badge, except that it has three messages instead of two. Figure 2-1 shows the code you should write to complete the Saying Hello badge.

tip To get help with completing badges, click the Click for Hints link on the progress bar at the top of the mod, or watch the video to see how to solve the challenge. Sometimes it’s tricky to position the blocks in the right spot, so you can always reorder them after you have applied them to your programming environment, though. Later in this book, I introduce you to the cut-and-paste process ...

Get Minecraft Modding For Kids For Dummies now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.