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

Can anyone point out why my ore Isn't dropping any XP? I'm clueless

 

public void dropBlockAsItemWithChance(World world, int par2, int par3, int par4, int par5, float par6, int par7){

       

        super.dropBlockAsItemWithChance(world, par2, par3, par4, par5, par6, par7);

       

        if (this.idDropped(par5, world.rand, par7) != this.blockID){

       

        int xp = 0;

        xp = MathHelper.getRandomIntegerInRange(world.rand, 2, 75);

       

        this.dropXpOnBlockBreak(world, par2, par3, par4, xp);

Haven't tried this but shouldn't it be == instead of != in your if statement.

 

It depends on whether or not the id that is being dropped is his ore or not. Usually if it is the ore then the block won't drop experience and will instead drop experience during smelting. He probably has another item being dropped besides his ore, so it would then make sense to drop experience since you wouldn't be smelting the item at all.

If you really want help, give that modder a thank you.

 

Modders LOVE thank yous.

  • Author

I haven't set it to drop anything else, So By default I'm guessing its dropping itself, which it does in-game. If that helps

Well, what you are basically telling it to do is:

 

If the block I mined is not (the block I want's ID), then drop XP.

You are basically CANCELLING the whole process because the if statement can't send you to the things you want it to do, since it doesn't match.

 

Like Jdb100 said, try replacing != with ==, unless you are doing something extremely different then how we are seeing it.

  • Author

I can't edit it right now as I'm on my iPad in bed; but ill be sure to do what you guys have suggested tomorrow, thanks!

Guest
This topic is now closed to further replies.

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.