Super Digger

Introduction

Let’s create a program that gives you super digging powers!

Super digging!

Mine a little

Fill in air to fill replace the block below the player with air.

blocks.fill(AIR, pos(0, 0, 0), pos(0, -1, 0))

Mine some more

Set the coordinate values in the from position to (-1, 0, 1). Then, set the values in the to position as (1, 1, 1). This will mine out a wider and taller volume of blocks.

blocks.fill(AIR, pos(-1, 0, -1), pos(1, 1, 1))

Try digging

Go to Minecraft and move near something. If your world isn’t flat, you will dig out blocks near you when you run the program.

Mine a lot

We don’t want to mine just a few blocks at a time, so edit the from and to positions to mine a 5x5x5 cube. Digging it big time now!

blocks.fill(AIR, pos(-2, 0, -2), pos(2, 5, 2))

Try a big dig

Go to Minecraft and try moving next to things and then run the program again! GRIEFING ALERT! This mod can mess up your world!

Keep digging and digging

Put the fill operation inside a forever loop to repeat the fill forever. Change the -2 values to -5 and the 2 values to 5 in the positions.

# @highlight
def on_forever():
    blocks.fill(AIR,
        pos(-5, 0, -5),
        pos(5, 5, 5))
loops.forever(on_forever)

Try it again

Go back to Minecraft and run the program. Now, as you move you will be an unstoppable force of destruction! GRIEFING ALERT! This mod can mess up your world!

Step 8: Dig under your feet

Edit the from position to dig under the player’s feet.


def on_forever():
    blocks.fill(AIR,
        # @highlight
        pos(-5, -5, -5),
        pos(5, 5, 5))
loops.forever(on_forever)

Run the program

Go to Minecraft, put your player in flying mode and then run your program. GRIEFING ALERT! This mod can mess up your world!