Leap of faith
Let’s build a Leap of Faith mini-game.
Step 1
Put in an ||player:on chat command||
and rename it to lof.
player.onChat("lof", function () {
})
Step 2
Insert a ||blocks:fill||
to fill a 3x3x3
pool of water in the ground.
player.onChat("lof", function () {
blocks.fill(
WATER,
pos(-1, -3, -1),
pos(1, -1, 1)
)
})
Step 3
Go to Minecraft, press t to open the chat and enter lof. Check to see that a pool of water is created.
Step 4
Add another ||blocks:fill||
to build a 3x3
stone platform that goes up 128 blocks high.
player.onChat("lof", function () {
blocks.fill(
WATER,
pos(-1, -3, -1),
pos(1, -1, 1)
)
blocks.fill(
STONE,
pos(-1, 128, -1),
pos(1, 128, 1)
)
})
Step 5
Go to Minecraft and enter lof in the chat. Make sure a pool and a platform are created.
Step 6
Add a ||player:teleport to||
at the end of the command to teleport the player above the platform.
player.onChat("lof", function () {
blocks.fill(
WATER,
pos(-1, -3, -1),
pos(1, -1, 1)
)
blocks.fill(
STONE,
pos(-1, 128, -1),
pos(1, 128, 1)
)
player.teleport(pos(0, 130, 0))
})
Step 7
Place a ||gameplay:change game mode to||
after the ||player:teleport to||
to turn on survival
mode for the player.
player.onChat("lof", function () {
blocks.fill(
WATER,
pos(-1, -3, -1),
pos(1, -1, 1)
)
blocks.fill(
STONE,
pos(-1, 128, -1),
pos(1, 128, 1)
)
player.teleport(pos(0, 130, 0))
gameplay.setGameMode(
SURVIVAL,
mobs.target(NEAREST_PLAYER)
)
})
Step 8
Go to Minecraft and enter lof to play your game!