I remember an episode from the 1997 TV series Roar featuring a young Heath Ledger where the Spear of Destiny, also known as the Holy Lance or the Lance of Longinus, appeared as a plot device, but I ask: when was this legendary lance, that pierced the side of Jesus as he hung on the cross, first used as a plot device (not as a MacGuffin)?
The literary use of the Spear of Destiny or "Holy Lance" is inextricably tied up with Arthurian legend and especially the Holy Grail, but it took until the 19th Century to be called the Spear that pierced Jesus's side.
Percival is at a banquet at the castle of the Fisher King, who has a wound that does not heal. Various items such as candelabra and a bleeding lance. He sees a serving-bowl or "grail" carried back and forth by a young woman. He is curious but is too polite to ask anything.
Perceval is later told that his reticence at the banquet was a moral failure: Had he asked "Whom does the Grail Serve?" the Fisher-King would have been healed of his wound.
The knight Amfortas had been given the Grail and the Spear to guard, but it was stolen from him, the thief Klingsor stabbing Amfortas with it. The wound does not heal and can only be healed by the Spear.
As part of the Quest for the Grail, Parsifal
disarms Klingsor and the Spear changes allegiance gets the Spear from Klingsor when he throws it at Parsifal and it refuses to kill the virtuous knight.
At the end, Parsifal heals Amfortas with the Spear and allows Parsifal to reveal the Grail.