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

I'm assuming I should use rayTraceBlocks but I'm not sure how to use it. Can anyone help?

Creator of the MyFit, MagiCraft, Tesseract gun, and Papa's Wingeria mod.

  • Author

I want to find how far the player is from the ground

Creator of the MyFit, MagiCraft, Tesseract gun, and Papa's Wingeria mod.

Still not sufficient enough. Define "ground".

 

Ground can be world height in given place or ANY block that is below you (which would also count if you were high on floating island or deep down in caves.

 

No, you don't need to use rayTrace, if you just want to check what is below you you take player's pos and iterate down and check what block is on "player.posY - iteration". Now depending on "ground" definition - if ground would be ANY block that's it, but if you want to have ground height then it can get harder. Solutions may include saving world's height in given x/z into chunkData when world is generated.

1.7.10 is no longer supported by forge, you are on your own.

  • Author

The ground is the closest block downwards from the player.

Creator of the MyFit, MagiCraft, Tesseract gun, and Papa's Wingeria mod.

Look at lines 510, 524, and 537

You can link to specific lines on Github either by appending
#L<line>

to the URL or just clicking on the line. You can also link to a range of lines using

#L<start>-L<end>

at the end of the URL.

In addition, you can link a range of lines by clicking a line number and then shift-clicking another line number.

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

Thanks, I've seen people link to a specific line before, I just wasn't sure how to do it. Learn something new everyday. Hopefully some of that code was useful.

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.