Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

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!

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

  • Author
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.

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.

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
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.