Natural Disasters in Minecraft Pi

A meteor strike

Introduction

I have created natural disasters in minecraft using python. It adds many disasters to your minecraft that happen randomly wherever you are in your world. The program randomly starts disasters on it’s own so you should keep moving to avoid getting hit.

The Disasters

Disaster Name Effects Duration Image Extra Info
Earthquake Creates random holes around you. About 1 minute. an earthquake Effects have a range of about 15 blocks from the epicentre.
Sinkhole Creates hole in the ground below you. Instant.  A sinkhole The hole has random edges.
 Meteor Fires a meteor from the sky that crashes into the ground below you. Instant.  A meteor strike The meteor will not stop until it either reaches the highest point of the world at your position or the program crashes.
Meteor shower Fires down 10 meteors that crash into the ground around you. 10 meteors.  A meteor shower The best thing to do when this occurs is to stand still and wait, the meteors from this disaster only rarely crash into you.
Heatwave Causes the area around you to die out. 50 – 90 seconds. a heatwave Only affects wood logs, leaves, water, and grass.
Geyser Creates a column of water that starts at y -60 and ends 5 blocks above the highest point in your world. 25 seconds. a geyser The flood left behind once it ends  takes a while to dry up.
Eruption Erects a massive structure using water and lava. 1 minute and 15 seconds.  an eruption Lava still remains on the inside.

What this code requires to run

Example of how to manually start a disaster

To start a meteor at the position 0, 0 I would use:

meteor(0, 0)

Example of my code

def meteor(x, z):
 mc.postToChat('Meteor approaching!')
 y = 64
 h = mc.getHeight(x, z)
 x -= (64 - h)
 meteorSound.play()
 while y > h:
 y -= 1
 x += 1
 mc.setBlocks(x-2, y-2, z-2, x+2, y+2, z+2, block.OBSIDIAN.id)
 time.sleep(0.05)
 mc.setBlocks(x-2, y-2, z-2, x+2, y+2, z+2, block.AIR.id)
 mc.setBlocks(x-2, y-2, z-2, x+2, y+2, z+2, block.LAVA.id)
 mc.setBlocks(x-1, y-1, z-1, x+1, y+1, z+1, block.OBSIDIAN.id)

the full code is in the download link below

Code Downloads

To download my code click here.

Advertisements

5 thoughts on “Natural Disasters in Minecraft Pi

  1. I have unzipped the code in my downloads but when I come to run it is doesn’t find the sounds. Could you post instructions on how to run this and where I save the download etc. I am new and still learning

    Like

    1. Hi, only just noticed this comment sorry. Here are some steps to follow to make sure that the program finds the sounds:

      Make sure that the sounds are unzipped into the same folder as the program.

      Make sure that you are in the same folder as the program if the sounds are unzipped as well (this happens by default in IDLE).

      If these don’t help, can you send me the error message you get so that I can try to figure out what went wrong.

      Like

    2. Hi, only just noticed this sorry.
      You can save the program anywhere it will have access to the Minecraft API (This means saving the program in the MyAdventures folder on PC). Also make sure that you saved the sounds in the same folder as the program as the program searches for the sounds in the folder it’s in. Make sure that you run it in IDLE as well because the program starts the disasters in a separate thread and only has a main loop in that separate thread. Hope this helps.

      Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s