Leap of faith
Let’s build a Leap of Faith mini-game.
Chat command
Put in an ||player:on chat command||
and rename it to lof.
player.onChat("lof", function () {
})
Make a water pool
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),
FillOperation.Replace
)
})
Try the chat command
Go to Minecraft, press t to open the chat and enter lof. Check to see that a pool of water is created.
Build a stone surrounding
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),
FillOperation.Replace
)
blocks.fill(
STONE,
pos(-1, 128, -1),
pos(1, 128, 1),
FillOperation.Replace
)
})
Try it again!
Go to Minecraft and enter lof in the chat. Make sure a pool and a platform are created.
Teleport player
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),
FillOperation.Replace
)
blocks.fill(
STONE,
pos(-1, 128, -1),
pos(1, 128, 1),
FillOperation.Replace
)
player.teleport(pos(0, 130, 0))
})
Set Survival Mode
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),
FillOperation.Replace
)
blocks.fill(
STONE,
pos(-1, 128, -1),
pos(1, 128, 1),
FillOperation.Replace
)
player.teleport(pos(0, 130, 0))
gameplay.setGameMode(
SURVIVAL,
mobs.target(NEAREST_PLAYER)
)
})
Play the game!
Go to Minecraft and enter lof to play your game!