Streamy 0 Report post Posted July 2, 2018 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! Share this post Link to post Share on other sites
aw_wolfe 13 Report post Posted July 2, 2018 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 Share this post Link to post Share on other sites
Streamy 0 Report post Posted July 2, 2018 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. Share this post Link to post Share on other sites
aw_wolfe 13 Report post Posted July 2, 2018 if you are setting the position, you could try and set the velocity and add to the y value. Think you also need call velocitychanged to cause an update to the client. Share this post Link to post Share on other sites