A peasant of Hermsdorf, now a district of Berlin, one evening saw a Jack o’lantern. He approached same when the “Jack o’lantern” took off running. The peasant pursued and later observed that whatever it was it “had most wonderfully long legs, and from top to toe consisted of glowing fire…” 
Elsewhere, near Storkow, Germany a clergyman and his servant driving their cart home late at night saw a Jack o’lantern approaching. Whatever it was, it “merrily danced along with the horses.” This dancing Jack o’lantern mutated into many such creatures and the clergyman could not drive them away with his prayers. Finally, the servant shouted, “Will ye be off in the devil’s name!” This did the trick and not a Jack o’lantern was to be seen. 
One man, a cowherd near Rathenow, Germany dared to do battle with the dancing Jack o’lanterns. Sitting on the stump of an old tree and smoking his pipe, the cowherd was suddenly surrounded by the dancing Jack o’lanterns. Frustrated, the man took his stick and struck about, but to no avail. “At last he made a grasp at one of them, and found that he held in his hand a bone.” 
We find strange things in what is called “traditions and superstitions” from olden times. On the one hand there is the approved “history”; on the other hand there is oral tradition, passed down among common people from generation to generation. In the strange case of the Pied Piper of Hamelin, later embellishments have transformed a “something” which in fact happened into a so-called “fairy tale.”
On June 26, 1284, in the German town of Hamelin, 130 of the town’s children “left.” A man about 30 years old played a “magnificent silver pipe” which fascinated the children who followed him out of town. The children all disappeared into a mountain near the town. (Background: Strange Case of Pied Piper, Ersjdamoo’s Blog, June 7, 2015.)
When the women began to look for their children, the man said to them that he would come again in 300 years and take more children. 
Putting on my thinking cap, the honored tinfoil hat, the idea came to me of Stephen King’s novel, It. In that tale, a cyclical nature to strange events akin to the seeming 300-year cycle of Hamelin is seen. “IT” is an eternal entity that is almost as old as time itself. “IT” is the natural enemy of Maturin (The Turtle), who both exist in the Macroverse. After arriving to Earth, “IT” would sleep for approximately 28 to 30 years at a time, then awaken to wreak chaos and feed (primarily on the fear of children). It is able to take many more forms than the film version depicts, including werewolves, bats, leeches, and even Jaws. 
For millions of years, “IT” dwelt under Derry, awaiting the arrival of humans, which “IT” somehow knew would occur. Once people settled over “IT’s” resting place, “IT” adopted a cycle of hibernating for long periods and waking approximately every 27 years:
- 1715 – 1716: “IT” awoke.
- 1740 – 1743: “IT” awoke and started a 3-year reign of terror that culminated with the disappearance of over 300 settlers from Derry Township, much like the Roanoke Island mystery.
- 1769 – 1770: “IT” awoke.
- 1851: “IT” awoke when a man named John Markson poisoned his family, then committed suicide by eating a white-nightshade mushroom, causing an excruciating death.
- 1876 – 1879: “IT” awoke and went back into hibernation after a group of lumberjacks were found murdered near the Kenduskeag.
- 1904 – 1906: “IT” awoke when a lumberjack named Claude Heroux murdered a number of men in a bar with an axe. Heroux was promptly pursued by a mob of townsfolk and hanged. “IT” returned to hibernation when the Kitchener Ironworks exploded, killing 108 people, 88 of them children engaged in an Easter egg hunt. 
Yes, I know that the Stephen King book is fiction. Nonetheless “IT” offers a line of thinking which may help explain the 1284 “pied piper” incident. Stephen King’s creature is a shape-shifter. “IT” is capable of taking many forms, including werewolves, bats, leeches, and even Jaws. The “pied piper” of 1284 may have been only a form taken by whatever the underlying entity truly was. Another form taken elsewhere by the shape-shifter could have been dancing Jack o’lanterns.
The “pied piper” may have been a form taken by Loki, the “trickster.” In Norse mythology, Loki is a god or jötunn (or both). Loki is a shape-shifter and in separate incidents he appears in the form of a salmon, mare, seal, a fly, and possibly an elderly woman. The role of Trickster, the Deceiver, is found in many of the world belief systems. The Northern Deceiver is Loki. In mythology, a Trickster is a god, goddess, spirit, human hero or animal who plays pranks or otherwise disobeys normal rules and norms of behavior. Titles given to Loki include Sly One, Lie-Smith, Sly-God, Shape-Changer, Sky Traveler, and Sky Walker. 
The Trickster in another form was studied by the late John E. Mack, MD. The form taken in those case studies involved extraterrestrial aliens and abductions of humans. But whatever form taken seems to partake of human consciousness appropriated by the Trickster and used to “IT’s” own purposes. The Trickster was also involved in the Salem “witchcraft” incident of 1692.
——- Sources ——-
 Northern Mythology: Popular Traditions and Superstitions of Scandinavia, North Germany, and The Netherlands (Vol. III), by Benjamin Thorpe. London: Edward Lumley, 1852
 “The Pied Piper of Hamelin: A Medieval Mass Abduction?”, by Medievalists.net, December 7, 2014. http://www.medievalists.net/2014/12/07/pied-piper-hamelin-medieval-mass-abduction/
 “It (Stephen King)”, Villains Wikia. http://villains.wikia.com/wiki/It_%28Stephen_King%29
 In Praise of Cotton Mather, by Brian Francis Redman. Lulu.com, 2011.