Jump to content

help with player ascend speed


Streamy
 Share

Recommended Posts

So I've just started working with mods and I'm relatively new to Java so I would like to keep the "LEARN JAVA" comments to minimal, This is more of a question than a support thread but 

I'm trying to run a command that makes a player ascend at a slow speed 100 blocks upwards. I must admit i'm still learning and I may look like an idiot to some of you but when i use player.motionY It sends me upwards only a few blocks (Based on the value)

I want to know how i would make a player ascend on the Y axis slowly at a constant rate and stop after ascending 100 blocks. 

Thanks anyone who can help!

Link to comment
Share on other sites

one simple way, not sure if works with what you are trying to do, but if you add a levitation potion effect, this should accomplish the slow rise, just set the duration to make the player rise higher.

 

Otherwise, I think you'd have to catch the event PlayerTickEvent and check to see if effect wanted, deal with storing the initial block pos, and storing whether effect is on/off --- should do with capabilities

Link to comment
Share on other sites

11 minutes ago, aw_wolfe said:

one simple way, not sure if works with what you are trying to do, but if you add a levitation potion effect, this should accomplish the slow rise, just set the duration to make the player rise higher.

 

Otherwise, I think you'd have to catch the event PlayerTickEvent and check to see if effect wanted, deal with storing the initial block pos, and storing whether effect is on/off --- should do with capabilities

Sorry, I don't think I was clear in what i wanted to do. I was hoping to set the player in fly and have the player ascend upward. I am able to set the player into fly and have them ascend using player.motionY but they either ascend slowly and not for long or they go the proper distance but ascend much too fast. I just wanted to know if there was a way to have a player ascend while flying at a constant rate.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.