JAMES COOK had moral courage, quiet self-confidence, humanity, an open mind, good temper, and an infinite capacity for taking pains. These qualities, as much as his genius as a navigator and hydrographer, persuaded the British Admiralty to give him command of three voyages of exploration in the Pacific. He was the last man to take himself for a god, yet it was as a god he died, stabbed and clubbed, face down in a rock pool on a Hawaiian beach. His luck had run out long before that bloody beach scene in 1778; it was gone even before his ships set out in search of the Northwest Passage.

Cook had posthumous luck in dhis biographer, the late J. C. Beaglehole, who edited his journals and finally wrote a Life (Stanford University Press, $18.50) that is exhaustive, lively and eloquent, though like other works of devotion it glides lightly over what might discredit his hero. More Cook literature has been prompted by the 200th anniversary of his murder: among it a fictional journal of the last voyage by Hammond Innes; an expert retelling of the events of that voyage by Richard Hough (available in this country in late September); and a fine collection of essays written for a conference commemorating Cook's arrival at Vancouver Island in March 1778 (available in August). Among them is one tha unlocks the mystery of what went wrong on the last voyage.

It began optimistically enough, for Cook's first two expeditions had made him a national hero. He had started his career humbly in the coastal coal trade, then become a ship's master in the Royal Navy whose accurate surveys of the St. Lawrence River, Labrador and Newfoundland showed genius. When it came to choosing a commander for an expedition to Tahiti to record an eclipse and to search for an imagined southern continent, Cook, though not yet even an officer, was the best man for the job. During his first two round-the-world voyages he carted the coast of New Zealand and east Australia, scoured the high latitudes, reducing the dimensions of terra australis incognita to Antarctica, discovered new archipelagos, determined longitude correctly with the first chronometer, and drastically improved health and hygiene on his ships. Though he only partly understood the role of Vitamin C in scurvy prevention, his dietary regulations included enough anti-scorbutics to prevent the wholesale deaths long voyages had always entailed.

On his return in 1776 in Royal Society made him a Fellow, the King received him, his published journals were an instant best seller, and a third voyage was projected. Cook's ship would again be the sturdy collier Resolution accompanied by the smaller Discovery under the command of Charles Clerke, a humorous, capable young man who would die of tuberculosis before journey's end. But instead of overseeing the ships' refitting, Cook polished his journals, dined out, sat for his portrait, and confabulated with George III. He finally sailed in June instead of April; the unsupervised, slipshod overhaul of his vessels was to lead ultimately to his murder.

Such delay and carelessness were unlike him. To make matters worse, Cook had agreed to transport the King's gift of blooded livestock for breeding in Tahiti. "A floating farmyard was one thing," Hough writes, "a professional expedition of hardened explorers another." Troubles began at once. As they sailed down the Atlantic off the Cape Verde Islands on a clear, calm night, the ship's surgeon, taking the air on deck, saw breakers dead ahead. Then Cook, who was on watch - with no lookout - woke to the danger, but it is no easy matter to maneuver a square-rigged vessel. Shipwreck was narrowly averted. William Bligh, the ship's 22-year-old master, and as brilliant a navigator and hydropgrapher as Cook himself, was appalled. (Fourteen years later, after being cast adrift in a tiny launch with 18 others by the Bounty mutineers, Bligh was to perfrom one of the greatest feats of navigation ever recorded, bringing the overloaded boat to safety across 3600 miles of open sea.)

The Admiralty had ordered Cook to proceed to Tahiti without delay but stops had to be made, often unnecessarily prolonged, for supplies, fodder and repairs to the leaky ships at Capetown, New Zealand, and the Friendly Islands. Captain Clerke observed of these islands they had enjoyed on the last trip that "chastity is by no means the reigning virtue," nor was it anywhere in Polynesia. Cook strove vainly to keep those of his crew afflicted with "the venereals" away from the eager women, dreading to visit on them a curse of civilization. Like all Polynesians, the Friendly Islanders exercised inexhaustible skills in theft. The ships were stripped of tools and metal, even the nails that held their copper bottoms on. Cook began to deal out dire punishments: six dozen lashes, blasts of shot, amputated ears. Clerke's sense of humor worked better: culprits caught on the Discovery were shaved on one side - scalp, face, and beard - and heaved overboard. Though a great island called "Fidgee" was said to be three days' call distant, the great explorer showed no curiosity to find and chart it, instead frittering away nearly three months in a place he already knew well.

The passage to Tahitti entailed the misadventures already usual on this voyage: stornms, a lost mast, injured men, leaks, short supplies; but once the ships reached harbor it was euphoria again. "They are angels," one man wrote of the girls. But all too soon, at Moorea, tragedy was precipitated by Cook's utter loss of self-control. A goat was stolen; as punishment he ordered a 40-hour orgy of smashing and burning. The goat was returned, but the lovely shore was a smoking ruin and the friendly people had lost everything. "And all about such a small trifle as a goat," one man wrote.

Yet Cook's serendipity remained among the ruins of his virtues. Sixteen days after leaving Tahiti in January 1778 on a course to North America, islands never seen before by white men rose on the horizon. The natives who paddled out spoke the language of this whole vast watery world, and swarmed aboard bringing the familiar Polynesian problems - thievery and willing women. Cook lingered for three weeks at Kauai, one of the islands in a paradise he named the Sandwich Islands.

In March Vancouver Island was sighted, and in Nootka Sound, as guests of friendly Indians who serenaded them in wild, melodious chorus, they made repairs and took on supplies. Storms, leaks and chill fogs followed them north, and so did Cook's erratic judgment. At the tip of the Aleutian Peninsula, running before the wind in dense fog - everyone but Cook wide-eyed with alarm - someone heard thunderous breakers ahead. The two ships hove to and when the fog lifted found themselves hemmed in by rocks and reefs on three sides. "Very nice pilotage," remarked Clerke wryly.

At last on a brillant day in the Bering Strait the Alaskan and Siberian arctic coasts stretched away on either side, snowless; ahead lay clear water into te Arctic Ocean. But within an hour the ships were imprisoned between the rocky Alaskan coast and a 12-foot wall of ice driven by a strong wind. It took two days to escape this trap, not before Cook ordered walruses slaughtered for fresh meat. The men gagged at it - "disgustful" - and Cook; whose own palate one seaman described as "the coarsest ever mortal was endured with," responded by calling them "damn mutinous scoundrels."

Before deciding to return to the Sandwich Islands for the winter, Cook managed a further series of blunders: he announced they would sail home over the top of Russia, but was forced to give up this mad shceme by ice and snow: back in Alaska he got himself trapped in the shallowed waters of a bay and again barely escaped shipwreck; when the ships required wood and water, he ordered them out to sea, away from a shore rich with timber and tumbling rivers, to another nearwreck off an island he had sighted four times already and given three different names. "A disgrace to us navigators," fumed Bligh. Cook managed a perfect landfall across 800 miles of fogbound water in the Aleutians, where they found fish, water, wood, and delicious salmon pies sent from a Russian trading settlement.

The run south was easy and the ships crusied the Sandwich Islands, never landing, trading buttons and knives for fruit, pigs and girls. Cook nearly brought about mutiny by trying to force a "healthful decoction" of sugar-cane beer down his men's throats and then, once more, came within a whisker of shipwreck trying to round a cape at night in heavy seas lit by lightning. After 10 weeks they finally anchored at Kealakekau Bay on "Owhyhee" to be greated by 10,000 hysterically excited people swarming the water. The priests made it plain that this was no ordinary Polynesian frenzy: Cook was being received as a god promised the Hawaiians in their legends. The entertainment was dazzling, the bare-breasted girls who clambered over the ships day and night were insatiable, but the daily exchange of gifts soon exhausted the island's resources. The visit had been like a highly-charged dream, rich and disturbing.

Within hours of Cook's departure a sudden storm split a rotten mast and opened a serous leak. Apprehensively they returned to the bay, but behind the smiling faces eveyone now sensed hostility. Brazen theft commenced at once. A shore party was stoned, and Cook ordered that any more "onsolence" be met with musket balls. During the night the Discovery's large cutter was spirited away. Determined to take an important hostage against its recovery, Cook was rowed ashore, followed by a launch full of marines. The amiable king, roused from sleeip, agreed to spend the day aboard the Resolution , but a weeping throng stopped him and pressing round Cook, threatened him with knives. He yelled at his marine bodyguard to open fire. After one round, they fled toward the water, knife-wielding natives hacked them to pieces on the rocks. Cook waved at the backup launch to approach and rescue him; instead the officer in charge moved away. Then as he walked toward the water with desperate dignity, Cook was brought down and killed with clubs and long knives.

Where had it all gone so wrong? How could the decisive, compassionate, brilliant leader have become the vacillating man whose zest for discovery had turned to apathy, who disregarded instructions and timetables, made gross navigational errors, committed follies of seamanship, flew into rages (his heivas , they were called, after the violent Polynesian dances), handled his own men with stubborn tactlessness and the natives with heartless cruelty?

In a novel that pretends to be a private diary kept during the last voyage, Hammond Innes fails to shed even speculative light on Cook's transformation. He has cobbled together a narrative out of deplorable paraphrases of Cook's vigorous journal with passages of his own poor invention that only suggest a fretful nail-biter. Unlike the true records, this fiction is without style, savor, insight or life.

Richard Hough's book is a beautifully told account of the fata voyage, making use of many documents and points of view, and he provides much more information about some of the near-catastrophes than Beaglehole does. Though he has no final answer to the question, What wnet wrong? he concludes, "Pathology rather than psychology is likely to be our best guide."

Sir James Watt, a physician, goes farther in his fascinating essay on "Medical Aspects and Consequences of Cook's Voyage" in the symposium. Among these aspects he considers the drastic changes in Cook's personality. He had begun to ail on the second voyage with severe gastrointestinal symptoms that suggest a heavy infestation of roundworms. The inflammation they cause in the intestinal wall allows colonization by coliform bacteria which interfere with the absorption of important nutrients, including the B vitamins. Symptoms of Vitamin B deficiency exactly match those that Cook is well known to have suffered: constipation, loss of concentration and of interest, depression, irritability, change of personality. The man who would eat anything and eagerly shared native messes that his "mutinous" men wouldn't touch had fallen victim to his own conviction that fresh food would keep men alive and well on long voyages. In the search for Vitamin C he was done in by Vitamin B. CAPTION: Illustration 1, Engraving of Captain Cook, 1837 (The Bettmann Archive, Inc.); Illustration 2, Engraving of Captain Cook (The Bettnam Archive, Inc.)