Bouncing Pigs

Introduction

Pigs bouncing in the air

Each time you bounce, the game spawns a new pig!

Slime area

Put code in the ||player:on chat|| event to make a pool ||blocks:filled with slime||. The pool should span from ~-20 ~0 ~-20 to ~20 ~0 ~20.

player.onChat("slime", function () {
    blocks.fill(
    SLIME_BLOCK,
    pos(-20, 0, -20),
    pos(20, 0, 20),
    FillOperation.Replace
    )
})

Bouncing

Add an event to run code when the ||player:player bounces||.

player.onTravelled(TravelMethod.Bounce, function () {
})

Spawning pings

Add code to ||mobs:spawn a pig|| above the player on a ||player:bounce||.

player.onTravelled(TravelMethod.Bounce, function () {
    mobs.spawn(PIG, pos(0,20,0))
})

Random pigs

To make things more fun, ||positions:pick a random position|| where the ||mobs:pig|| will ||mobs:spawn||.

player.onTravelled(TravelMethod.Bounce, function () {
    mobs.spawn(PIG, randpos(
    pos(-10, 20, -10),
    pos(10, 20, 10)
    ))
})

Try it

Go to Minecraft, press ENTER and type slime. Then bounce on the slime…