Coding Ireland STEM Report 2024 Have Your Say
30 mins
160 points
What you need:
  • Computer/laptop
  • Minecraft Education Edition

Super Jump

Create a command to teleport super high into the air. Learn how you can pass a number into a command to change how it works.

1 - Open Minecraft

In this project we are going to learn how to create a command to make your player teleport super high in the air.

First, open Minecraft Education Edition, login, create a new world and open the Code Builder.

2 - Create a command

Add a on chat command block and rename it it to "jump". Then add a teleport to block and set the y (up) value of the position block to be 100.

player.onChat("jump", function () {
    player.teleport(pos(0, 100, 0))

When this code runs it will teleport your player 100 blocks above your current position.

3 - Run the "jump" command

Go to your Minecraft world and run the jump command. You will see that your player gets teleported high into the sky.

4 - Specify how high

Next let's change our "jump" command so that we can specify how high to jump. We will pass a number into the command and use that number to set the y (up) value in the teleport block.

Open the Code Editor and click the + button on your "jump" command. This will create a new variable called "num1". Then get the num1 block from the Variables toolbox and put it into the y value in the position block.

player.onChat("jump", function (num1) {
    player.teleport(pos(0, num1, 0))

5 - Run the "jump" command again

Now run the jump command again but this time put a space and then a number after "jump". For example to make your player jump 50 high type this in the chat command "jump 50".

Try some other numbers with the jump command and see how it changes how high you jump!

Join our club 😃

To view the remaining 3 steps and access hundreds of other coding projects please login or create an account.

Copyright Notice
This lesson is copyright of Coding Ireland. Unauthorised use, copying or distribution is not allowed.
🍪 Our website uses cookies to make your browsing experience better. By using our website you agree to our use of cookies. Learn more