Hi, I'm a begginer and I tried to create a new Ore for my mod.
So it's a Cobalt Ore which drop cobalt when you break it with a diamond pickaxe, till then it works.
But I've a searched a method to make the enchantment fortune (enchanted pickaxe) make it drop more than one cobalt.
I found a example but, I think I did something wrong, or my method is outdated.
Here's my block class :
package wwrp.Blocks;
import java.util.Random;
import cpw.mods.fml.common.registry.GameRegistry;
import wwrp.Common.Modwwrp;
import net.minecraft.block.material.Material;
import net.minecraft.block.Block;
import net.minecraft.item.Item;
public class BlockwwrpcobaltOre extends Block
{
public BlockwwrpcobaltOre()
{
super(Material.rock);
setHarvestLevel("pickaxe",3); // 3= DIAMOND PICKAXE
this.setHardness(4.5F);
this.setStepSound(Block.soundTypeStone);
}
public int quantityDropped(int meta, int fortune, Random random)
{
return quantityDroppedWithBonus(fortune, random);
}
@Override
public Item getItemDropped(int metadata, Random random, int fortune)
{
return wwrp.Common.Modwwrp.cobalt;
}
}
In my principal class :
cobaltOre = new BlockwwrpcobaltOre().setBlockName("cobaltOre").setCreativeTab(wwrpTab).setBlockTextureName(modid + ":" + "oreCobalt");
GameRegistry.registerBlock(cobaltOre, "cobaltOre");
Can you help me again ?
Thank you in advance !