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've been trying to sort this out for a few days but unfortunately I've had no success. I was wondering if anyone has figured out how to add xp drops to an ore for 1.17.1. Anyone help would be appreciated, thanks!

  • Author

I should've mentioned that's what I've done the past few days. I don't wanna be told exactly how to do it just a little guidance 

  • Author

@Override public int getExpDrop(BlockState state, LevelReader reader, BlockPos pos, int fortune, int silktouch) { return silktouch == 0 ? this.RANDOM.nextInt(10) : 20; }
this is what i've recently tried and it did drop xp but it drops it regardless if silk touch is involved or not

the code should work, if the SilkTouch level is 0 it will return a random xp count between 0 and 9, if the SilkTouch level is not 0 it will return constantly 20

  • Author

Ah i see the issue i had it set to give 20 xp with silk alright. Is there anything i can replace random with so for example itll always drop 10 xp

  • Author

Ok so i have this right which means without silk touch it'll drop between 0-9 xp and 0 with silktouch so i assume the 0-9 is because of that this.RANDOM. So im wondering if i can change that RANDOM so it always drops the 10 xp or if im just over thinking this

@Override

public int getExpDrop(BlockState state, LevelReader reader, BlockPos pos, int fortune, int silktouch) {

return silktouch == 0 ? this.RANDOM.nextInt(10) : 0;

}

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.