4

So once I was inspired by some game on another platform to make it's parkour moves in minecraft. I knew that without commands, I was not able to do it. Luckily, I have done some commands before and thought that it was possible with the command /execute.

Some time later after experimenting with commands to come up with how to boost the player up, i run into a problem.

I decide to make it a little more realistic by making sure that the player only jumped high when he/she was looking up. So of course, I try this command:

/execute at @p[y_rotation=-90] as @p[y_rotation=-90] if block ~ ~-0.01 ~ minecraft:stone run effect give @s minecraft:levitation 1 10

I tried it, but it seemed that it did not run the command when I was looking up. Since i'm a person that was discouraged from trying other choices, I came here to ask,

What is the command?

  • 2
    "thought that it was possible with the command /execute" I recommend reading or watching a commands tutorial. /execute does absolutely nothing on its own. If your thought process of doing something in Minecraft starts with /execute, you're planning wrong. Also, your selector is redundant and would even cause problems once you start using @a. Better: execute as @p[y_rotation=-90] at @s – Fabian Röling May 31 at 8:25
3

You need to use the x axis if you want to test for players looking up/down. Testing for y is for players looking left or right.

So this will work (tested with 1.13.2):

/execute at @p[x_rotation=-90] as @p[x_rotation=-90] if block ~ ~-0.01 ~ minecraft:stone run effect give @s minecraft:levitation 1 10


Edit to clarify:

This is not a bug. You just need to think of the axis to be threaded and try to screw it in somewhere:

enter image description here

If you rotate X the player will look up or down and rotating Y will let them look left or right.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.