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

In the Drones and Locations set of badges are specific badges related to Minecraft locations. The fun part about having the location of a player or drone is that you can make things happen directly at that location, such as strike lightning.

Use Locations to strike lightning on yourself in Minecraft

Make sure you’re in Creative mode while in Minecraft when you test this badge. Here is Locations Part I challenge.

Here is the final batch of code you write to make lightning strike on yourself.

image0.jpg

This code example uses two new blocks:

  • world strike lightning at: You can find it under the Minecraft category and then World.

    image1.jpg
  • location of: You can find it under the Minecraft category and then Entities.

    image2.jpg

When you run this mod in either Minecraft or the simulator, two things happen:

  • You see the lightning descend from the sky.

    image3.jpg
  • The grass around you catches fire.

    image4.jpg

Use Locations to strike lightning on drones in Minecraft

In the Locations Part 2 challenge, you can read how to strike lightning on drones rather than on yourself. This information can come in handy when you’re trying to defend structures you’ve created.

Check out the code you need in order to strike lightning somewhere other than on yourself.

image5.jpg

You can strike lightning in multiple places by using multiple drones — neat-o!

This shows you how to make three drones and strike lightning on each of them.

image6.jpg

Being able to make multiple drones can also come in handy if you want to make multiple structures. Each drone can be in charge of making a different structure, and you don’t have to reset one before making something new.

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: