Mega Jump
Introduction
Build a mod that lets you jump high… as high as you want!
Chat Command
Put in an ||player:on chat command||
and rename it to jump.
player.onChat("jump", function() {
})
Teleport the player
Place a ||player:teleport||
inside ||player:on chat command||
to teleport the player 100
blocks higher.
player.onChat("jump", function() {
player.teleport(pos(0, 100, 0))
})
Use your slash command!
Go to Minecraft, type t to open the chat and enter jump.
Add a parameter to the slash command
Add a number parameter called num1
to ||player:on chat command||
. In Blocks, click on the (+).
player.onChat("jump", function (num1) {
player.teleport(pos(0, 100, 0))
})
Jump the amount entered by the user.
Use the ||variables:num1||
variable instead of 100
in the code so you will jump by the amount entered by the player.
player.onChat("jump", function (num1) {
player.teleport(pos(0, num1, 0))
})
Use your slash command!
Go to Minecraft and enter jump 50 in the chat. You should jump by 50 blocks instead of 100. Try jump 1000…