There’s plenty of lava in the minecraft world if you dig deep enough, but hardly any on the surface! Let’s change that by building our very own volcano!
Your challenge, should you choose to accept it, is to build an erupting volcano in the minecraft world… Start nice and simple by building a pyramid shape and then add a sprinkling of random gravel to make it look realistic. Once you are done, get the lava flowing.
Step1. Create the base
The first thing you need to do is to create the base of the pyramid. See if you can fill in the ?’s to build the base.
Step2. (easy version)
Build the rest of the volcano
The easy way to add the rest of the volcano is to just copy the code that you used above on to the next line and keep adding lines of code until you have a full volcano. Have a go and see if you can build the rest of the volcano!
Step 2. (hard version)
The easy version is okay for small volcanoes, but what about a really big volcano? Things soon start getting out of hard so really we want to use a loop instead! See if you can complete this while loop to build your volcano.
Step 3. Add random blocks of gravel
Your volcano is probably looking more like a pyramid at the moment so we want to sprinkle some random blocks of gravel on top. See if you can convert the pseudo code below to get your code working!
|Import the random moduleLoop 100 times:
x = random number between the startx and endx of the base.
Z = random number between the startz and endz of the base
Drop a gravel block at z, 50, z
Never used the random function before? Don’t worry, it’s easy! Try the code below. The only thing to be aware of is that the code below will generate a random number between 0-9, not 0-10!!!
Step 4. Make your volcano erupt!
Okay, this last bit is easy! Just add a loop that puts a block of lava at the top of your volcano once every second!
- Make a volcano that only erupts every so often…
- Make a volcano only out of randomly placed blocks with the pyramid