Hi there, and thanks for helping me.
I have made a pickaxe that detects when something is meltable, and melts it, but when I try to add the result into the inventory, which I do with "player.inventory.addItemStackToInventory(stack);".
public boolean onBlockDestroyed(ItemStack par1, World par2, Block par3, int x, int y, int z, EntityLivingBase par4){
if(!par2.isRemote){
ItemStack stack = FurnaceRecipes.smelting().getSmeltingResult(par1);
if(stack != null){
if(par4 instanceof EntityPlayer){
EntityPlayer player = (EntityPlayer) par4;
player.inventory.addItemStackToInventory(stack);
return true;
}else{
return false;
}
}else{
return false;
}
}else{
return false;
}
}
And I can mine one time, and get the item, and the rest of the times, it just go througt the code, to "player.inventory.addItemStackToInventory(stack);", and past, but does not give me the item.
What am I doing wrong?