Project 7

Modding with Projectiles

Being able to build objects, send drones out, or trigger events can be fun; but being able to cast mods out into the world and have them affect the area around where they land is powerful. In this project, I show you how to make and run a mod that projects a block into the world and causes an explosion when it lands.


Design and Build an Exploding Projectile

In this section, I show you how to write a mod that, when run in Minecraft, causes a block to be thrown from your location. When the block lands, it causes an explosion, destroying anything around it. You can later modify this fun, powerful mod to have it do other things also, such as teleport you to where it landed.

Design the launch and explosion

Before you start coding, plan your strategy. Writing this exploding projectile mod isn’t as complex as a minigame mod, but you need to design its complex pieces still (such as where it should be thrown from and what should happen when it lands).

For starters, you have to define these two actions to make the block

  • Launch when the mod is run
  • Explode when it lands

Plan the block launch

When you run your mod, make a block (maybe bedrock) to start from your position and move up and away from you. Designing the code for a three-dimensional (3D) mod is kind of tricky because you can’t draw it easily on paper. (3D involves six directions: up, down, ...

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

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