In other media, this is more commonly referred to as a "Soul Jar", and the TV Tropes site probably has the best overall writeup (link). Among the citations from mythology and fairy tales are stories such as the Russian "Tsarevich Petr and the Wizard" (link), in which a terrible wizard has hidden his soul in an egg on a far-off magical island; the Norwegian "Giant Who Had No Heart in His Body" (link), with a broadly similar theme in which a terrible giant has hidden his heart in a far-off secreted egg; and also a Native American myth about another giant who hid his soul in a pinecone on top of an unclimbable mountain. TV Tropes also mentions "The Picture of Dorian Gray" as a similar case (link).
Of course, the idea has now been used with variations in a great many fantasy stories written in the 20th Century (including Lord of the Rings, Harry Potter, Wheel of Time, Discworld, etc., etc.) One of the stories mentioned by TV Tropes, the mostly likely to be directly influential on Gygax's D&D, is the Fafhrd & Gray Mouser novella "Adept's Gambit" by Fritz Leiber (actually the first he ever wrote about the pair -- link). This story ultimately turns around a wizard who mentally enslaves his twin sister over many years of growing up together. Their mother is descended from priestesses pledged to an ancient god, and the young wizard seems unable to travel away from a set of three stones taken from that ancient temple; so ultimately he switches places with the sister, carries away the three stones, and imprisons her (in his body) in a tomb for many years. Separately, he also manages to remove his heart and vital organs, leaving them with the magic stones, such that his own body is invulnerable to death when discovered (at least as long as the innards in another location remain whole). The Leiber story isn't a perfect match for the D&D magic jar spell, but it does share many overall aspects. (Perhaps it's a better match for the D&D Expert Rules adventures X3 by Doug Niles, X5 by Dave Cook, and X10 by Michael S. Dobson, each of which feature an evil high priest who is invulnerable to harm due to putting his soul in a hidden container this way. Or likewise any lich in the game.)
Anyway, that's as much of the literary/mythological background as I could dig up. Let's see how the magic jar spell evolved in the D&D game, starting with the earliest edition:
Magic Jar: By means of this device the Magic-User houses his life force in some inanimate object (even a rock) and attempts to possess the body of any other creature within 12" of his Magic Jar. The container for his life force must be within 3" of his body at the time the spell is pronounced. Possession of another body takes place when the creature in question fails to make its saving throw against magic. If the possessed body is destroyed, the spirit of the Magic-User returns to the Magic Jar, and from thence it may attempt another possession or return to the Magic-Users body. The spirit of the Magic-User can return to the Magic Jar at any time he so desires. Note that if the body of the Magic-User is destroyed the life force must remain in a possessed body or the Magic Jar. If the Magic-Jar is destroyed the Magic-User is totally annihilated.
Note that the specific example of a magic jar device given above is "a rock", which would seem to connect it to the Leiber story mentioned above (where the life of the wizard was connected to three stones from an ancient temple). Note also that the 12" range limitation is only applicable to the initial possession of another body; no range limitation is given for return to the jar from other death or will of the magic-user. That makes it a very powerful protective ploy (just like in its literary and mythological forebearers), as the wizard can take on any adventures with no fear of his or her life actually being in jeopardy. Also, once possession occurs, there's no chance given for the victim to shake off the possession (although we can assume that a dispel magic or remove curse should likely do the job). Compare those aspects to what happens later, below.
D&D Expert Rules
With this spell, the caster puts his or her body in a trance and transfers his or her life-force to an inanimate object (magic jar) within range. From this object, the spell caster may attempt to possess (take over) any one creature within 120' of the magic jar. If the victim makes a successful saving throw, the possession has failed and the caster may not try that victim again for one game turn. If the victim fails the saving throw, the creature is possessed and its body will do as the caster wills. While under the control of the spell caster no spells of the possessed may be used. If the possessed body is destroyed, the magic-user or elf must return to the magic jar. From there the caster may try to possess another body or return to his or her own. The caster can be forced out of the possessed body by a dispel evil spell.
Destroying the magic jar while the caster's life force is in it kills the caster. Destroying the magic jar while the caster's life-force is in another body strands the life-force in the possessed body. Killing the caster's real body strands the life-force in the magic jar until the caster can possess another body! Once the caster returns to his or her real body the spell is over.
This is pretty much the same thing as in OD&D (as usual). Dave Cook explicates that the clerical dispel evil seems to be the only thing to remove a possession. He also interprets destroying the magic jar as stranding the life-force in whatever body it's in (thereby possibly leading to real death); whereas if I read the OD&D text's last line, I would think that "the Magic-User is totally annihilated" immediately, wherever the soul was at the time. (Perhaps I should read the last two sentences in OD&D as being in sequence, instead.) Cook also states that the spell ends when the caster returns to his or her real body, a detail which was not present before. All-in-all, it seems that the OD&D spell was possibly a more permanent and severe switch, possibly irrevocable by the wizard, and a trigger for automatic death if the magic jar was discovered and destroyed (just like in the traditional myths).
AD&D 1st Ed.
Magic Jar (Possession)
Area of Effect: One creature
Explanation/Description: Magic jar is a very unusual spell. It enables the magic user to take over the mind of the victim and thus control the creature's body. In fact, if the body is human or humanoid, the magic-user can even use the spells he or she knows. The possessor can call upon rudimentary knowledge of the possessed, but not upon the real knowledge, i.e. a possessor will not know the language or spells of the possessed. The spell caster transfers his or her life force to a special container (a large gem or crystal), and from this magic jar the life force can sense and attack any creature within the spell range radius, but what the creature is, is not determinable from the magic jar. The special life force receptacle must be within spell range of the magic-user's body at the time of spell casting. Possession takes place only if the victim fails to make the required saving throw. Failure to possess a victim leaves the life force of the magic-user in the magic jar. Possession attempts require 1 round each. If the body of the spell caster is destroyed, the life force in the magic jar is not harmed. If the magic jar is destroyed, the life force is snuffed out. Returning to the real body requires 1 round, and can only be done from a magic jar in spell range of the body. The saving throw versus a magic jar spell is modified by comparing combined intelligence and wisdom scores (intelligence only in non-human or non-humanoid creatures) of the magic-user and victim.
A negative score indicates the magic-user has a lower score than does his or her intended victim; thus, the victim has a saving throw bonus. The magic jar is the spell's material component. Note that a possessed creature with any negative difference or a positive difference less than 5 is entitled to a saving throw each round to determine if it is able to displace the possessor's mind, a positive difference of 5 to 8 gains a saving throw each turn, a positive difference of 9 to 12 gains a saving throw each day, and a positive difference of 13 or better gains a saving throw each week. If the magic jarred creature regains control of its mind, the magic-user is trapped until he or she can take over the mind for control or escape.
Here's Gygax's revision of this "very unusual spell" for Advanced D&D. Among the significant changes are that he allows access to some of the possessed person's rudimentary knowledge (which does occur in the Leiber story). The spell changes the arbitrary "inanimate object" from OD&D to "a large gem or crystal" in AD&D, perhaps to better signal its great important in the story of the game (apparently, a simple rock is no longer permitted). And there's also a complicated, unique save mechanic and possibility of the possessed regaining their mind later. I'll leave it as an exercise to the reader if you can interpret how that obtuse mechanic works.
One thing I've noticed in the past is that in the switch from the OD&D LBBs to the AD&D hardcover books, there are instances when Gygax "takes for granted" rules from OD&D, and either omits or overlooks their inclusion in AD&D -- and frequently these are the most critical parts of some sub-system. Examples that come to mind: text explaining use of the Monster Reactions table, system for hits in Aerial Combat, most of the statistics for Naval Combat (encounter-level speeds, sail-vs-wind-points, turning, ramming system, crew and marine numbers), etc.
With that in mind, in the lengthy text for the 1E magic jar spell above, note that it does explicate that possession of another's body, and return from jar-to-real-body, are limited to the range listed for the spell (1"/level, or 11" for a name-level Wizard, basically the same as in OD&D/BX). It also defines what happens if the real body is destroyed ("life force... is not harmed"), or the magic jar is destroyed ("life force is snuffed out"). But the spell entirely fails to say what happens if a possessed body is attacked or killed. And of course presumably that's the most important part of the spell, the whole reason for using it in the first place. We might continue using the OD&D rule that a spirit can return to the jar without restriction (and maybe by inference from the last line above when one regains their own mind, but it's very vague). Or if someone didn't have OD&D at hand, they could reasonably interpolate that out-of-range = impossible to return and destroyed (and by analogy to the written jar-back-to-real-body rule). To me that seems like an almost unconscionable oversight in this block of rules text; and yet, it is so long and complicated, it's easy to see how that happened -- it took me many re-readings to confirm that such a specification was in fact missing.
AD&D 2nd Ed.
Range: 10 yds./level
Area of Effect: 1 creature
The magic jar spell enables the caster to shift his life force into a special receptacle (a gem or large crystal). From there the caster can force an exchange of life forces between the receptacle and another creature, thus enabling the wizard to take over and control the body of another creature, while the life force of the host is confined in the receptacle. The special life force receptacle must be within spell range of the wizard's body at the time of spellcasting. The wizard's life force shifts into the receptacle in the round in which the casting is completed, allowing no other actions.
While in the magic jar, the caster can sense and attack any life force within a 10-footper-level radius (on the same plane); however, the exact creature types and relative physical positions cannot be determined. In a group of life forces, the caster can sense a difference of four or more levels/Hit Dice and can determine whether a life force is positive or negative energy.
For example, if two 10th-level fighters are attacking a hill giant and four ogres, the caster could determine that there are three stronger and four weaker life forces within range, all with positive life energy. The caster could try to take over either a stronger or a weaker creature, but he has no control over exactly which creature is attacked. An attempt to take over a host body requires a full round. It is blocked by a protection from evil spell or similar ward. It is successful only if the subject fails a saving throw vs. spell with a special modifier (see following). The saving throw is modified by subtracting the combined Intelligence and Wisdom scores of the target from those of the wizard (Intelligence and Hit Dice in nonhuman or nonhumanoid creatures). This modifier is added to (or subtracted from) the die roll.
A negative score indicates that the wizard has a lower total than the target; thus, the host has a saving throw bonus. Failure to take over the host leaves the wizard's life force in the magic jar.
If successful, the caster's life force occupies the host body and the host's life force is confined in the magic jar receptacle. The caster can call upon rudimentary or instinctive knowledge of the subject creature, but not upon its real or acquired knowledge (i.e., the wizard does not automatically know the language or spells of the creature). The caster retains his own attack rolls, class knowledge and training, and any adjustments due to his Intelligence or Wisdom. If the host body is human or humanoid, and the necessary spell components are available, the wizard can even use his memorized spells. The host body retains its own hit points and physical abilities and properties. The DM decides if any additional modifications are necessary; for example, perhaps clumsiness or inefficiency occurs if the caster must become used to the new form. The alignment of the host or receptacle is that of the occupying life force.
The caster can shift freely from the host to the receptacle if within the 10-foot-per-level range. Each attempt to shift requires one round. The spell ends when the wizard shifts from the jar to his own body.
A successful dispel magic spell cast on the host can drive the caster of the magic jar spell back into the receptacle and prevent him from making any attacks for 1d4 rounds plus 1 round per level of the caster of the dispel. The base success chance is 50%, plus or minus 5% per level difference between the casters. A successful dispel magic cast against the receptacle forces the occupant back into his own body. If the wizard who cast the magic jar is forced back into his own body, the spell ends.
If the host body is slain, the caster returns to the receptacle, if within range, and the life force of the host departs (i.e., it is dead). If the host body is slain beyond the range of the spell, both the host and the caster die.
Any life force with nowhere to go is treated as slain unless recalled by a raise dead, resurrection, or similar spell.
If the body of the caster is slain, his life force survives if it is in either the receptacle or the host. If the receptacle is destroyed while the caster's life force occupies it, the caster is irrevocably slain.
So that's quite a lot of rules text for a spell you probably never used, right? Cook keeps the core of the spell the same, as was his modus operandi. He adds about two paragraphs about the misty sensory ability that the wizard's life-force has while in the magic jar. The unique saving throw mechanic and table are identical to 1E. There's more specification to the exact physical-mental-alignment split that occurs while possessed. He adds a paragraph ruling on dispel magic to drive out a possessor. And just like in his Expert Rules, he adds in two key rulings not found in either of Gygax's writeups: (1) returning to the real body ends the spell; and (2) destruction of the magic jar strands the life-force, not destroying it immediately (the opposite of what Gygax seems to say clearly in both OD&D and 1E).
But perhaps the most critical detail is that Cook adds back a specification on what happens if a possessed body is slain, filling in a gap left open by Gygax in 1E. Cook says, "If the host body is slain, the caster returns to the receptacle, if within range, and the life force of the host departs (i.e., it is dead). If the host body is slain beyond the range of the spell, both the host and the caster die." (emphasis mine). Is that an honest interpretation from the 1E text, where it was left unstated? Or was this Cook's personal preference in changing how the spell functions (different, albeit, from the Expert rules)?
In either event, the spell is now much less powerful as a protective device for the evil magic-user. Instead of roaming all over the world in a hijacked body (as in the mythological tales or Leiber's story), the user must instead remain within 120 feet of the jar and the original body, at all times, in order to benefit from its life insurance. They're effectively trapped or entombed wherever the magic jar is stored (or at least required to carry it with them on excursions).
D&D 3rd Ed.
Level: Sor/Wiz 5
Components: V, S, F
Casting Time: 1 action
Range: Medium (100 ft.+10 ft./level)
Target: One creature
Duration: 1 hour/level or until the character returns to the character's body
Saving Throw: Will negates (see text)
Spell Resistance: Yes
By casting magic jar, the character places the character's own soul in a gem or large crystal (known as the magic jar), leaving the character's body lifeless. Then the character can attempt to take control of a nearby body, forcing its soul into the magic jar. The character may move back to the jar (returning the trapped soul to its body) and attempt to possess another body. The spell ends when the character sends the character's soul back to the character's own body (leaving the receptacle empty).
To cast the spell, the magic jar must be within spell range and the character must know where it is, though the character does not need line of sight or effect to it. When the character transfers the character's soul upon casting, the character's body is, as near as anyone can tell, dead.
While in the magic jar, the character can sense and attack any life force within 10 feet per caster level (on the same plane). The character does need line of effect from the jar to the creatures. The character, however, cannot determine the exact creature types or positions of these creatures. In a group of life forces, the character can sense a difference of four or more HD and can determine whether a life force is positive or negative energy. (Undead creatures are powered by negative energy. Only sentient undead creatures have, or are, souls.)
Attempting to possess a body is a full-round action. It is blocked by protection from evil or a similar ward. The character possesses the body and forces the creature’s soul into the magic jar unless the subject succeeds at a Will save. Failure to take over the host leaves the character's life force in the magic jar, and the target automatically succeeds at further saving throws if the character attempts to possess its body again.
If successful, the character's life force occupies the host body, and the host’s life force is imprisoned in the magic jar. The character keeps his or her Intelligence, Wisdom, Charisma, level, class, base attack bonus, base save bonuses, alignment, and mental abilities. The body retains its Strength, Dexterity, Constitution, hit points, natural abilities, and mental abilities, such as water breathing or regeneration. A body with extra limbs does not allow the character to make more attacks (or more advantageous two weapon attacks) than normal. The character can’t choose to activate the body’s extraordinary or supernatural abilities. The creature’s spells and spell-like abilities do not stay with the body. As a standard action, the character can shift freely from a host to the magic jar if within range, sending the trapped soul back to its body. The spell ends when the character shifts from the jar to the character's own body.
If the host body is slain, the character returns to the magic jar, if within range, and the life force of the host departs (that is, it is dead). If the host body is slain beyond the range of the spell, both the character and the host die. Any life force with nowhere to go is treated as slain.
If the spell ends while the character is in the magic jar, the character returns to the character's body (or dies if the character's body is out of range or destroyed). If the spell ends while the character is in a host, the character returns to the character's body (or dies, if it is out of range of the character's current position), and the soul in the magic jar returns to its body (or dies if it is out of range). Destroying the receptacle ends the spell, and the spell can be dispelled at either the magic jar or the host.
Incorporeal creatures with the magic jar ability can use a handy, nearby object (not just a gem or crystal) as the magic jar.
Focus: Worth at least 100 gp.
So 3E keeps most of the same mechanics as 2E. It collapses the saving throw back to the standard mechanic, allowing it to get rid of the special table and a few paragraphs of rules text. It keeps the 2E requirement that all transfers (esp., when a host body gets killed ) be within the limited range of the spell (200 feet or so). But this is probably a lot less important because of the new, much greater limitation added to the spell -- in that the duration is now capped at a very restrictive 1 hour/level, so the spell can't possibly last more than about half a day or so. No wandering the world in a stolen body for you, nor lurking in the darkness waiting for a victim and freedom for years! At this point I'm not even sure what the motivation or use of the spell would be in a literary context -- it seems like both the magic jar and the real body would have to be immediately at hand any time it gets used, and thus at risk of destruction or hostage-taking by whomever you're trying to victimize.
ConclusionsI think that's one of the more interesting spell-evolutions in D&D, even for a spell that possibly never actually gets used in play. It started out as a rather clear simulation of certain mythological and literary magics, and devolved consistently over the years to something that's almost vestigial, highly restricted, and perhaps totally unusable. Part of this was assisted in the AD&D 1E era by Gygax apparently getting lost in his own wall of text and neglecting to mention the single most important aspect of the spell (what happens when a possessed body gets killed?). So in those respects it wraps up many of the threads in "Spells Through the Ages" in a single magical package.
What's your experience with the magic jar spell? Have you ever used it as a player, or as a DM?