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.

deyahruhd

Members
  • Joined

  • Last visited

Everything posted by deyahruhd

  1. First: double playerX = Math.floor(Minecraft.getMinecraft().thePlayer.posX); The floor function maps a number to its largest preceeding integer (e.g. 29.99 -> 29.00), so you will have a value ending with .00. Second: if (coordinate > 0) { float v = coordinate - .99; if (x = (int) x) { // the player's positive coordinate ends with .99 } } else { float v = coordinate + .99; if (x = (int) x) { // the player's negative coordinate ends with .99 } } Note: if the coordinates have more than two digits after the decimal point, this code will mess up. If that is the case, be sure to truncate the floats.
  2. The solution to your problem is so incredibly simple. It's seriously part of basic Java knowledge. ClassicBrickStairs does not have a constructor that takes a Material. It takes a Block and an int. The Block it takes in is the "material" it is made of, so if I wanted to make grass stairs I would put a grass block in there.
  3. Get the position of the block relative to the entity's position, multiply the resulting vector by some factor then move the entity with that vector. If you want it to act like gravity, have the factor be affected by the entity's distance to the block. All simple vector math.

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.