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

Hello.

 

So I've recently begun my second mod which I've named Jake's Gems which adds gems very similar to the ones in RedPower2. Yes, I'm aware this idea is not very original, but I wanted to make it both as a learning experience and something to complement a custom modpack of mine.

 

Anyway the problem I'm having is just like the title says. My custom ore is unaffected by being broken with a Fortune Pickaxe.

 

Here is the code in my RubiteOre class:

 

package jakegems;

import java.util.Random;

import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
import net.minecraft.util.MathHelper;
import net.minecraft.world.World;

public class RubiteOre extends Block {

public RubiteOre(int id, Material material) {
	super (id, material);

	setHardness(1.5f);
	setStepSound(Block.soundStoneFootstep);
	setUnlocalizedName("newBlock");
	setCreativeTab(CreativeTabs.tabMisc);
}

public int idDropped (int metadata, Random random, int fortune) {
	return JakeGems.gemRubite.itemID;
}

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 xporbs = 0;
		xporbs = MathHelper.getRandomIntegerInRange(world.rand, 0, 12);

		this.dropXpOnBlockBreak(world, par2, par3, par4, xporbs);
	}

}
}

 

Any and all help received is greatly appreciated, thank you!

 

Laterz,

~Jake

  • 1 month later...

I believe this is the method you're looking for:

public int quantityDropped(int meta, int fortune, Random random)
    {
        return quantityDroppedWithBonus(fortune, random);
    }

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

 

Modders LOVE thank yous.

Thank you :) I ended up finding it in the Redstone ore class but now others will have the answer too when they are searching for this!

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.