Super Digger

Introduction

Let’s build a command that gives you super digging powers!

GRIEFING ALERT! This mod can mess up your world!

Super digging!

Step 1: On Player Walk

Add an ||player:on player walk|| event to run code when the player walks.

player.onTravelled(WALK, function () {
})

Step 2: Mine a little

Use ||blocks:fill|| to fill in air one block around you.

player.onTravelled(WALK, function () {
    // @highlight
    blocks.fill(AIR, 
        // @highlight
        pos(-1, -1, -1), 
        // @highlight
        pos(1, 1, 1)
    // @highlight
    )
})

Step 3: Try it

Go to Minecraft and walk around. Blocks should disappear behind you…and under you! Don’t fall in the void!

Step 4: Don’t walk, fly!

Instead of running the code when the player walks, run it when flying.

// @highlight
player.onTravelled(FLY, function () {
    blocks.fill(AIR, 
        pos(-1, -1, -1), 
        pos(1, 1, 1)
    )
})

Step 5: Try it

Go to Minecraft and fly around. Blocks should disappear behind you. No more falling into the void.

Step 6: Mine some more

Modify the values in ||blocks:fill|| to increase the volume of air you create.

player.onTravelled(FLY, function () {
    blocks.fill(AIR,
        // @highlight
        pos(-5, -5, -5), 
        // @highlight
        pos(5, 5, 5)
    )
})

Step 7: Try it

Go to Minecraft and fly away the world!