In a mod for minecraft I am making, I have an ore that I want to make mineable with only iron+ tier pickaxes. Right now, it does not matter what tool is used and it drops the ore itself. The code that's commented out will make it drop the item but not require a specific tool.
Code:
package net.minecraft.src;
import java.util.Random;
public class BlockDemoniteOre extends Block
{
protected BlockDemoniteOre(int i, int j)
{
super(i, j, Material.iron);
this.setCreativeTab(CreativeTabs.tabBlock);
}
public int idDropped(int i, Random random, int par3, EntityPlayer entityplayer)
{
if (entityplayer.getCurrentEquippedItem() != null && entityplayer.getCurrentEquippedItem().itemID == Item.pickaxeSteel.itemID)
{
return mod_DeathShard.dshard.itemID;
}
if (entityplayer.getCurrentEquippedItem() != null && entityplayer.getCurrentEquippedItem().itemID == Item.pickaxeDiamond.itemID)
{
return mod_DeathShard.dshard.itemID;
}
else
{
return 0;
}
}
/* public int idDropped(int i, Random random, int par3)
{
return mod_DeathShard.dshard.itemID;
}*/
public int quantityDropped(Random random)
{
return 1;
}
}