Hammerspace

Hammerspace (also known as malletspace) is an imaginary extradimensional, instantly accessible storage area in fiction, which is used to explain how characters from animation, comics, and video games can produce objects out of thin air. Typically, when multiple items are available, the desired item is available on the first try or within a handful of tries.
This phenomenon dates back to early Warner Bros.' Looney Tunes/Merrie Melodies and MGM cartoons produced during the Golden age of American animation. For example, in the 1943 Tex Avery short What's Buzzin' Buzzard, a starving vulture prepares to cook his friend by pulling an entire kitchen's worth of appliances out of thin air.
The phenomenon of a character producing plot-dependent items seemingly out of thin air dates back to the beginning of animated shorts during the Golden age of American animation. Warner Bros. cartoon characters are particularly well known for often pulling all sorts of things—hammers, guns, disguises, matches, bombs, anvils, mallets—from behind their backs or just off-screen. However, this phenomenon was mostly just left to suspension of disbelief. Only decades later was the term hammerspace jokingly coined to describe the phenomenon.
The term itself originates from a gag common in some anime and manga. A typical example would be when a male character would anger or otherwise offend a female character, who would proceed to produce, out of thin air, an over-sized wooden rice mallet (okine) and hit him on the head with it in an exaggerated manner. The strike would be purely for comic effect, and it would not have any long-lasting effects. The term was largely popularized first by fans of the 1978 series Urusei Yatsura and later by fans of Ranma ½ in the 1980s. It is believed by some that the term "hammerspace" itself was coined based on the Ranma ½ character Akane Tendo due to the fan perception that she has a tendency to produce large hammers from nowhere. In the original manga she much more frequently uses her fists or objects that were pictured in the nearby scenery. The anime makes more use of hammers as a comedic tool than the manga.
Another series that may have contributed to the term is City Hunter. One of the lead characters in City Hunter—Kaori—makes extensive use of the "transdimensional hammers" as they are sometimes called, as they are one of the two main running gags in the series; the other is the extreme lecherousness of the other main character—Ryo—which almost invariably leads to the use of said hammers. The City Hunter hammers also require more explaining in terms of storage, as they are often considerably larger than the characters themselves, and thus more likely to provoke surprise. Starting in 1985, City Hunter predates Ranma ½ by two years, and already had an extensive fanbase.
Another series that made extensive use of hammerspace was Kodomo no Omocha, where the mother of the main character would pull toy hammers of varying sizes to tap her daughter on the head to forge breaks in her ranting and offer a chance to glean understanding and wisdom. Trope-laden webcomic Okashina Okashi – Strange Candy also features hammerspace, this time named directly as such, accessible by the weapons nut Petra.
One of the oldest known usages of hammerspace in games is the bag of holding from the Dungeons & Dragons role-playing game, a magical container capable of holding more items than normally possible, its contents actually being held in a pocket dimension or part of the Astral Plane. An early computer example of the concept is the 1984 Infocom text adventure The Hitchhiker's Guide to the Galaxy, which contained a "Thing your Aunt gave you which you don't know what it is" as a humorous variant of the bag of holding concept (and which proved critical to finishing the game itself).
The idea of hammerspace can also be applied to many other video games, as game mechanics often defy those of the real world: for instance, a character may be able to carry a sword larger than themselves without any sign of it before use, and most video game characters can carry an implausible number of tools or other objects. This is particularly visible in traditional adventure games and RPGs, such as The Legend of Zelda. In New Super Mario Bros. Wii, the player has endless space to put their items. In many Super Mario games, the Hammer Bros. are capable of throwing an infinite supply of hammers from hammerspace. Early (and some modern) first-person shooter games tend to have the player character carry an entire arsenal of weapons (with a full level of ammunition) without any visible drawback such as loss of pace or fatigue. In the Grand Theft Auto game series, players are capable of holding an extremely large arsenal and equipment in hammerspace. This capability has more a significant appearance in Grand Theft Auto V, where the characters are able to carry multiple pistols, SMGs, LMGs, assault rifles, carbines, shotguns, sniper rifles, melee weaponry, throwables, explosive projectile launchers and a minigun all at once on themselves, with large amounts of ammunition, and all of them being previously invisible. In the Fallout series, NPCs and the player use hammerspace extensively, being capable of holding large amounts of weaponry, healing items, and more. For the player, these items are accessed via the Pip-Boy.
Many comical adventures make gags on space in item inventories. In Space Quest series III and VI, protagonist Roger Wilco crams a full-sized ladder into his pocket. In Simon the Sorcerer, Simon similarly obtains a ladder at one point, which he stores in his hat. In The Secret of Monkey Island, as a recurring gag, Guybrush Threepwood usually barely fits an oversized item in his clothes, from a six-foot-long cotton swab to a huge figurehead, or even a monkey (which is shown moving underneath his coat). At one point early in The Curse of Monkey Island, he makes a shocked face after sheathing a bread knife down his pants. A similar concept is evident in Sonic the Hedgehog, most notably with Amy Rose, who actually materializes hammers from hammerspace.
In some non-humorous cases, hammerspace may be recognized as a seemingly normal in-universe phenomenon. Characters from the Kingdom Hearts series are capable of materializing weapons from thin air and making them disappear again, notably in the case of main character Sora and his Keyblade, though it's implied that they are stored as magic in the wielders' hearts.
Although there are numerous examples from the genre, hammerspace usage is not just limited to adventure games. In The Sims 2, The Sims 3 and The Sims 4, the Sims make extensive use of hammerspace, regularly pulling items out of their back pockets which could not possibly fit there. Examples include rakes, hairdryers, watering cans and bags of flour, even though this may be a result of gameplay limitations.
Similarly, in the sandbox game Minecraft, the player character can carry thousands of tonnes of material such as gold or diamond in the character's inventory without encumbrance, as if an empty inventory were the same as a full one. In reality, just one block of most materials in Minecraft would weigh hundreds or thousands of kilograms, meaning the player can carry up to a little under 64,000 blocks in their inventory without hindrance. Since some blocks can be converted into multiple blocks of another type, it is possible to carry enough material in a single inventory to build a large settlement.
Hammerspace is also used frequently in fighting games. In the Super Smash Bros. games, Princess Peach is said to pull a Toad out of hammerspace for a blocking move. In the Punch-Out!! series many characters can pull out objects from hammerspace. In Guilty Gear, Faust is capable of pulling various items out from his medical scrubs in order to use in battle (though the items vary between games).