Project 8

Making a Multiplayer Minigame: Capture the Flag

In Project 7, I show you how to create a Projectile library, which you can use to create a mod that causes an explosion and to create a mod that teleports you to another location. I like to call these mods magic wands because, with only one motion, you can create a big effect! In this project, I explain how to create a Capture the Flag game where you use these wands to defend your flags, while you seek out your opponent’s flags.

In the early 1980s, Scholastic released a Capture the Flag–style game on one of the first home computers. Since then, many games have used this as a reference for their games (Call of Duty, Halo, and Team Fortress 2 are just a few) because of the competition that Capture the Flag inspires. In this project, I show you how to turn Minecraft into a Capture the Flag game and how to craft the competition however you like!

image

Plan the Capture-the-Flag Game

Before you start coding, you should plan your two-player Capture the Flag game on paper. To plan, think about the game in layers. Layer 1 is where you set up the game for Capture the Flag. Layer 2 is where you set up your libraries to use during Capture the Flag. Figure 8-1 shows what happens at each layer, and the rest of this project walks you through the steps to build the Capture the Flag minigame mod.

Prepare the Capture-the-Flag Mod ...

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.