@Override
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
if (player.isSneaking()) return false;
if (!world.isRemote) {
ItemStack item = new ItemStack(Block.woodDoubleSlab, 1, 0);
EntityItem entity_item = new EntityItem(world, (double)x + 0.5D, (double)y + 0.5D, (double)z + 0.5D, item);
entity_item.delayBeforeCanPickup = 10;
world.spawnEntityInWorld(entity_item);
world.setBlockToAir(x, y, z);
return true;
}
return super.onBlockActivated(world, x, y, z, player, side, hitX, hitY, hitZ);
}