Difference between revisions of "Bag of holding"

From NetHackWiki
Jump to navigation Jump to search
(updated to 3.6.0, +src ref)
(Exploding a bag of holding: upcoming)
 
(39 intermediate revisions by 12 users not shown)
Line 1: Line 1:
{{tool|name=bag of holding|tile=[[image:bag.png]]|appearance=bag|cost=100|weight=15|color=brown|material=cloth}}
+
{{tool
A bag of holding is one of the most coveted items in NetHack. Placing items into a noncursed bag of holding makes them weigh less, allowing you to carry more items.
+
|name=bag of holding
 +
|tile=[[image:bag.png]]
 +
|appearance=bag
 +
|cost=100
 +
|weight=15
 +
|color=brown
 +
|material=cloth}}
  
The prize at the end of [[Sokoban]] always has a 50% chance of being a bag of holding (it will otherwise be an [[amulet of reflection]]).
+
A '''bag of holding''' is a [[Magical item|magical]] [[tool]] that appears in ''[[NetHack]]''. It is made of [[cloth]], and is one of the most coveted items for general [[container]] use.
  
Attempting to remove items from a cursed bag of holding may make them vanish, with a separate 1/13 chance for each item.  
+
==Generation==
 +
The prize at the end of [[Sokoban]] always has a {{frac|2}} chance of being a bag of holding.
  
When non-greased bags of holding get wet, their contents may get wet. Greasing the bag protects against this, but the grease may wear off. You can also put the bag of holding in a non-cursed oilskin sack to protect it from water damage.
+
{{upcoming|NetHack 3.7.0|Both prizes are no longer equally likely for each floor. Instead, [[Sokoban Level 4a]] has a {{frac|3|4}} chance of the prize being a bag of holding, while 4b has a {{frac|4}} chance of the prize being a bag of holding.}}
  
== Identification ==
+
==Description==
A bag of holding is easy to identify: first confirm that it isn't a [[bag of tricks]] by seeing that you can put items into it, then pick up just enough gear to get encumbered, and put a fair amount of weight into the bag. If you become unencumbered, the bag must be a bag of holding. (One exception: putting [[gold]] in a sack or an oilskin sack might change your encumbrance even if the bag is not a bag of holding, because NetHack rounds the weight of your purse and the weight of the gold in your bag separately.)
+
Like other [[container]]s, the bag of holding can hold items beyond the 52-character limit - it also alters the [[weight]] of its contents, dependent on <math>cwgt</math> and the [[beatitude]] of the bag:{{refsrc|src/pickup.c|1235|nethack=3.6.7}}
  
[[Price identification]] can also help to distinguish the various bags: [[oilskin sacks]] and [[Bag of tricks|bags of tricks]] cost 100, while normal [[sack]]s cost 2. (Make sure there is nothing in the bag when you check the price.) Bags of tricks are also easily identifiable (better to #loot in a shop than to pay a usage fee).
+
{|class="wikitable"
 +
!BUC!!total weight
 +
|-
 +
|blessed
 +
|<math>15 + (\frac{cwgt}{4} + 1)</math>
 +
|-
 +
|uncursed
 +
|<math>15 + (\frac{cwgt}{2} + 1)</math>
 +
|-
 +
|cursed
 +
|<math>15 + (cwgt \times 2)</math>
 +
|}
 +
 
 +
In addition to increasing the weight of its contents, a cursed bag of holding may make items vanish, with a separate {{frac|13}} chance for each item each time you [[loot]], [[apply]] or [[tip]] it.
 +
 
 +
A bag of holding will also protect its contents from being broken when [[thrown]].
  
== Weight change ==
+
===Exploding a bag of holding===
The weight of a bag of holding (wgt) - including the 15 for the bag itself - depends on the weight of its contents (cwgt) and its [[BUC]]:
+
A magical explosion will occur if certain items are put in a bag of holding, destroying ''all'' the contents of the bag and any other bags placed into it, along with the bag itself, and damaging the player. These items are as follows:{{refsrc|src/pickup.c|2081|nethack=3.6.7}}
blessed:  wgt = 15 + (cwgt/4 + 1)
 
uncursed: wgt = 15 + (cwgt/2 + 1)
 
cursed:    wgt = 15 + cwgt*2
 
  
Generally speaking, bags of holding halve the weight of the objects contained, blessed bags divide it by four, and cursed bags double it.
+
* [[Bag of tricks|Bags of tricks]] with charges remaining{{refsrc|src/pickup.c|2087|nethack=3.6.7|name="charges"|Comment=An explosion will not occur if the offending object is uncharged}}
 +
* [[Wand of cancellation|Wands of cancellation]] with charges remaining<ref name="charges"/>
 +
* Other bags of holding{{refsrc|src/pickup.c|2091|nethack=3.6.7|name="nesting"|comment=The comment above this line details the resulting odds of a nested offending object causing an explosion}}
 +
* Other bags containing any of the above items, though they have a chance of not exploding [[#Nesting bags of holding|if you nest them]].<ref name="nesting"/>
  
==Putting dangerous items into bags of holding==
+
{{upcoming|3.7.0|Per {{commit|71754910db3be6effface4de88c35a056fe70c2c}}, exploding bags of holding scatter their contents rather than destroying them outright: [[fragile]] items are destroyed, and if caused by a bag of tricks, it is still lost along with the bag itself, while if caused by another bag of holding, that bag explodes as well per {{commit|9cdcf7b2194960c6ea8b98f2e2a6e71ee4a7959a}}. Per {{commit|6fd51c29ef120744098348798c17b7ee0595065f}}, {{frac|13}} of an exploded bag's contents are lost (not counting fragile items that are destroyed after), and per {{commit|ce1f4788cdbccaba1533bec1e478c0cc9bd550cf}}, monsters hit by scattered items are angered.}}
Some items should not be put in a bag of holding as they may make the bag explode, destroying ''all'' its contents.{{refsrc|pickup.c|1897|nethack=3.6.0}} These items are:
 
*other bags of holding
 
*bags of tricks with charges remaining
 
*[[wand of cancellation|wands of cancellation]] with charges remaining
 
*other bags containing any of the above items (these have a chance of not exploding if you nest them; see below)
 
The first two are straightforward to avoid; the wand can be trickier. To be safe, do not put any unidentified wands inside the bag that make engravings disappear (this includes cancellation, [[wand of teleportation|teleportation]], and [[wand of make invisible|make invisible]]).
 
  
 
==Strategy==
 
==Strategy==
Many players name a plain sack something like "Cancel" or "Don't ever put this in BoH!" and keep what could be wands of cancellation in that sack as a safety measure.
+
Bags of holding are useful for carrying large numbers of items, and are an essential part of an [[ascension kit]]. While magically protecting its contents from breaking when thrown, a bag of holding does not stop them from getting [[wet]] - to protect against this, you can apply [[grease]] to the bag or place it in a non-cursed [[oilskin sack]] to protect it from water damage.
 +
 
 +
===Item management===
 +
Due to the risks of losing your most valuable items if your bag is cursed or else explodes, many players also carry a plain [[sack]] to store other items. The sack can be used to hold items that are rare or hazardous to a bag of holding - many players name this bag something like "Cancel" or "Don't ever put this in BoH!" and keep wands of cancellation and other precious items such as [[artifact]]s or a [[wand of wishing]] inside as a safety measure.  
  
Item management becomes much less tedious if you additionally carry a sack around. Before [[stash]]ing or unstashing things, you temporarily put your entire main inventory into that sack ([[escape item]]s, primary weapon, often used tools, etc). Then you won't need to sort all your possessions whether you want them in your bag of holding or in the open. The same technique also helps avoid [[curse items|curses]] and [[nymph|theft]].
+
You can also store a bag of holding in a sack, which prevents it from being targeted by [[curse items]]. However, it will require two turns to take items out of the bag of holding.
  
Bags of holding are possibly the best candidate in the game for [[blessing]], since doing so doubles the amount you can carry in it.
+
===Handling cursed bags===
 +
If you find a [[bones]] pile with a bag of holding, it will probably be cursed and too heavy to lift. If you can still pick it up, then it can be uncursed with a [[potion of holy water]] or the [[scroll of remove curse|scroll or]] [[spell of remove curse]]. Otherwise, the best solution in general is to zap it with a [[wand of cancellation]] - the beam will only affect the bag and simply sets its beatitude to uncursed. Be sure to move any wands and tools out of the way beforehand, along with any other desired items that you suspect may be enchanted or charged.
  
Due to the risk of explosion, rare items like a [[wand of wishing]] or artifacts should probably not be kept in the bag of holding you use for dungeon loot.  Any such item that you aren't currently using should probably be kept in a normal or oilskin sack, both to reduce inventory clutter and reduce the risk of destruction by exterior forces (e.g. lightning bolts, trapped boxes, etc).
+
If cancellation is not available and the bag is too heavy to lift, you can #[[tip]] the bag - this will still make items vanish, but at least you can get everything else out without being limited by your inventory.
  
Consider putting your bag of holding into a [[sack]] on lower levels when not in use due to the prevalence of the [[curse items]] spell, especially once the [[Wizard of Yendor]] starts after you.
+
You can also allow a [[gelatinous cube]] to eat the bag if one is present: the cube will only eat the container itself, leaving the contents (including organic items) in its inventory, which will land safely on the ground when you kill the cube. Just make sure you can secure all the items before they are damaged - and only do this if you have no need for the bag itself.
  
If you find a bones pile with a cursed bag of holding, it will probably be too heavy to lift. (If it isn't, you can just pick it up and dip it in holy water, or use a scroll or spell of remove curse.) The best solution is to zap it with a wand or spell of cancellation. This will only uncurse the bag of holding and does not affect its contents. You can also allow a [[gelatinous cube]] to eat the bag: the contents, even the organic ones, will land safely on the ground when you kill the cube. Just make sure you can secure all the items before something damages them, since they will be vulnerable to monsters once out of the cube. This destroys the bag of holding, so don't do this if you need it.
+
===Avoiding bag explosions===
 +
Placing a bag of holding or bag of tricks inside your bag of holding is straightforward to avoid, provided you don't type the wrong letter by mistake; the wand of cancellation can be trickier. To be safe, do not put any unidentified wands inside the bag, unless you have [[engrave-test]]ed them and confirmed that they do not make engravings disappear - this rules out cancellation, along with {{wand of|teleportation|and=1|make invisible}}.
  
If cancellation is not available and the bag is too heavy to lift, you can [[tip]] the bag as a last resort. This will still make items vanish, but at least you can get everything else out without being limited by your inventory in how much you can remove.
+
It is usually best to avoid carrying more than one bag of holding or any bag of tricks when they are not in use, except perhaps while transporting them to a convenient [[stash]] location - neither is particularly useful to simply carry around, and you can't put one inside your bag of holding by mistake if you don't have it. Many players prefer to leave wands of cancellation at their stash as well, but these can be useful against monsters, so one must balance the increased risk in combat with the risk of making a potential game-ending mistake.
  
== Nesting bags of holding ==
+
===Nesting bags of holding===
 
It is possible, though risky, to first put items that would ordinarily cause a bag of holding to explode into sacks or oilskin sacks and then place them inside the bag of holding, without causing an explosion.
 
It is possible, though risky, to first put items that would ordinarily cause a bag of holding to explode into sacks or oilskin sacks and then place them inside the bag of holding, without causing an explosion.
  
In general, at most two nested bags of holding are useful because the payload is limited by your ability to lift the innermost bag, not by the outermost weight. You risk an explosion again every time you add contents.
+
In general, two nested bags of holding at most are useful - the payload is limited by your ability to lift the innermost bag, not by the outermost weight, and you risk an explosion every time you add contents.
  
The chance of an explosion occurring then depends on the amount of nesting:{{refsrc|pickup.c|1911|nethack=3.6.0}}
+
The chance of an explosion occurring then depends on the amount of nesting:<ref name="nesting"/>
 
{|class="wikitable"
 
{|class="wikitable"
 
!Number of sacks
 
!Number of sacks
Line 96: Line 117:
 
|}
 
|}
  
If they do not explode, the effect of the two bags will be cumulative, as expected: If both are blessed, any items in the innermost bag will have their weight reduced to about 1/16.
+
If they do not explode, the effect of the two bags will be cumulative, as expected: if both are blessed, any items in the innermost bag will have their weight reduced to about 1/16.
  
 
As can be seen in the table above, nesting bags of holding with more than 7 sacks in between makes explosion more likely, so there is no point in using more than 7 sacks.
 
As can be seen in the table above, nesting bags of holding with more than 7 sacks in between makes explosion more likely, so there is no point in using more than 7 sacks.
Line 136: Line 157:
 
|very small
 
|very small
 
|}
 
|}
For example, if you use 7 sacks between each of three bags of holding like this (H for bag of holding, s for sack): HsssssssHsssssssH (denoted as "7,7" in the table above), the chance of successful nesting would be 1-(8/128) for the first nesting, and then (1-(8/128)) * (1-(16/128)) for the second nesting (each of the two 'inner' bags of holding put into the outermost bag must pass its own independent roll for the nesting to succeed{{refsrc|pickup.c|1750}}) giving roughly a 23.1% chance that something will explode.
+
For example, if you use 7 sacks between each of three bags of holding like this (H for bag of holding, s for sack): HsssssssHsssssssH (denoted as "7,7" in the table above), the chance of successful nesting would be 1-(8/128) for the first nesting, and then (1-(8/128)) * (1-(16/128)) for the second nesting; each of the two 'inner' bags of holding put into the outermost bag must pass its own independent roll for the nesting to succeed {{refsrc|src/pickup.c|2229|nethack=3.6.7}} - this gives the example scenario roughly a 23.1% chance that something will explode.
 +
 
 +
Some players either consider the 6.25% chance of explosion from nesting to be an acceptable risk, or assume from a test in wizard mode that it is safe. If you are confident you can withstand the explosion, you can risk it before you leave the main dungeon to increase your score or bring specific items to the [[demigod bar]].<ref>[http://groups.google.co.uk/group/rec.games.roguelike.nethack/msg/3c393a4f7b6a432f? RGRN: "YAFAP - Scrappity - Arc - Gno - Neu - Survivor (Long)"]</ref>
 +
 
 +
==History==
 +
The bag of holding first appears in [[NetHack 3.0.0]].
 +
 
 +
From [[NetHack 3.3.0]] to [[NetHack 3.4.3]], including some variants based on those versions, [[Sokoban Level 4a]] always has a bag of holding as the prize.
 +
 
 +
==Messages==
 +
{{message|An <object> has vanished!|You applied or #looted a cursed bag of holding, causing a known item(s) to disappear.{{refsrc|src/pickup.c|2374|nethack=3.6.7}}}}
 +
{{message|You see <object> disappear!|As above, with an unidentified item(s) disappearing.{{refsrc|src/pickup.c|2376|nethack=3.6.7}}}}
 +
{{message|As you put <object> inside, you are blasted by a magical explosion!|You caused a bag of holding to explode by placing a charged bag of tricks, charged wand of cancellation or another bag of holding inside, destroying both objects and their contents.{{refsrc|src/pickup.c|2231|nethack=3.6.7}}}}
 +
 
 +
==Variants==
 +
===SLASH'EM===
 +
In [[SLASH'EM]], you can [[upgrade]] an ordinary [[sack]] or [[oilskin sack]] into a bag of holding. This typically makes the amulet of reflection found at the end of Sokoban a more valuable prize - there is still a {{frac|2}} chance of each reward, even with [[Sokoban (SLASH'EM)|the new levels]] introduced in the variant.
 +
 
 +
The [[Wallet of Perseus]] is an [[unaligned]] [[artifact]] bag of holding that has enhanced weight reduction, and enables you to informally identify a bag of holding via the '[[naming artifacts]]' trick.
 +
 
 +
SLASH'EM has a 'showweight' [[option]] that explicitly displays the amount of weight your character is carrying - informally identifying bags of holding is trivial with this option turned on.
 +
 
 +
===NetHack brass===
 +
In [[NetHack brass]], Sokoban offers a choice between 3 items, with one being a bag of holding.
 +
 
 +
===GruntHack===
 +
In [[GruntHack]], causing a bag of holding to explode does not destroy the contents of the bag, but scatters them and the player throughout the dungeon via [[level teleport]].
 +
 
 +
[[Sokoban (GruntHack)|Sokoban]] in GruntHack also offers a choice between 3 prizes, with one being a guaranteed bag of holding.
 +
 
 +
===SporkHack===
 +
In [[SporkHack]], an exploding bag of holding scatters its contents nearby, rather than destroying them outright - this will still destroy the inserted object, and fragile objects such as [[potion]]s and [[mirror]]s are broken as if they were thrown.
 +
 
 +
===UnNetHack===
 +
In [[UnNetHack]], exploding bags of holding react the same as in SporkHack, scattering most of its contents and destroying fragile items.
 +
 
 +
[[Sokoban (UnNetHack)|Sokoban]] in UnNetHack offers a choice between 3 prizes, with one being a guaranteed bag of holding.
 +
 
 +
===AceHack===
 +
In [[AceHack]], inserting a bag of tricks or a wand of cancellation inside a bag of holding will drain them of their charges rather than destroying any items inside - you can still destroy bags of holding by nesting them, but you will receive a confirmation prompt when doing so. This also applies to [[NetHack 4]], a 'successor' variant to AceHack.
 +
 
 +
===NetHack Fourk===
 +
In [[NetHack Fourk]], [[Sokoban (NetHack Fourk)|Sokoban]] now has set rewards for each of the possible maps that can appear as its final floor. [[Open at the Top]], which is essentially a clone of Sokoban level 4a, always has a bag of holding as its prize.
 +
 
 +
===xNetHack===
 +
In [[xNetHack]], an exploding bag of holding behaves as in SporkHack and some other variants: {{frac|13}} of the contents are destroyed along with the bag and inserted item, and the rest are scattered, destroying fragile items.
 +
 
 +
===EvilHack===
 +
In [[EvilHack]], an exploding bag of holding functions as in SporkHack and some other variants: {{frac|13}} of the contents are destroyed along with the bag and inserted item, and the rest are scattered, destroying fragile items.
 +
 
 +
[[Sokoban (EvilHack)|Sokoban]] in EvilHack offers 3 different type of prize item, and its prize tool has a {{frac|2}} chance of being a bag of holding.
 +
 
 +
The [[Bag of the Hesperides]] is an artifact bag of holding similar to the Wallet of Perseus that repels water like an oilskin sack, confers [[protection]] when carried, and is made of inherently fireproof [[dragonhide]] - it can only be obtained at the end of the [[Ice Queen's Realm]].
  
Some players either consider the 6.25% chance of explosion from nesting to be an acceptable risk [http://groups.google.co.uk/group/rec.games.roguelike.nethack/msg/3c393a4f7b6a432f?] or assume from a test in wizard mode that it is safe. If you are confident you can withstand the explosion, you can risk it before you leave the main dungeon to increase your score or bring specific items to the [[Demigod bar|ascension bar]].
+
===Hack'EM===
 +
In [[Hack'EM]], bags of holding behave as in EvilHack. The Wallet of Perseus also possesses most of the same traits as the Bag of the Hesperides from EvilHack, minus the location.
  
== References ==
+
==Encyclopedia entry==
<references />
+
{{encyclopedia|
 +
"Now, this third handkerchief," Mein Herr proceeded, "has also four edges, which you can trace continuously round and round: all you need do is to join its four edges to the four edges of the opening.  The Purse is then complete, and its outer surface--"
 +
"I see!" Lady Muriel eagerly interrupted.  "Its outer surface will be continuous with its inner surface!  But it will take time. I'll sew it up after tea."  She laid aside the bag, and resumed her cup of tea.  "But why do you call it Fortunatus's Purse, Mein Herr?"
 +
The dear old man beamed upon her, with a jolly smile, looking more exactly like the Professor than ever.  "Don't you see, my child--I should say Miladi?  Whatever is inside that Purse, is outside it; and whatever is outside it, is inside it.  So you have all the wealth of the world in that leetle Purse!"
 +
|[ Sylvie and Bruno Concluded, by Lewis Carroll ]
 +
}}
  
{{nethack-360}}
+
==References==
 +
<references/>
 +
{{nethack-367}}
 +
[[Category:Tools]]
 +
[[Category:Containers]]

Latest revision as of 23:48, 15 April 2024

( Bag.png
Name bag of holding
Appearance bag
Base price 100 zm
Weight 15
Material cloth
Monster use Will not be used by monsters.

A bag of holding is a magical tool that appears in NetHack. It is made of cloth, and is one of the most coveted items for general container use.

Generation

The prize at the end of Sokoban always has a 12 chance of being a bag of holding.

The following information pertains to an upcoming version (NetHack 3.7.0). If this version is now released, please verify that it is still accurate, then update the page to incorporate this information.

Both prizes are no longer equally likely for each floor. Instead, Sokoban Level 4a has a 34 chance of the prize being a bag of holding, while 4b has a 14 chance of the prize being a bag of holding.

Description

Like other containers, the bag of holding can hold items beyond the 52-character limit - it also alters the weight of its contents, dependent on cwgt and the beatitude of the bag:[1]

BUC total weight
blessed 15 + (\frac{cwgt}{4} + 1)
uncursed 15 + (\frac{cwgt}{2} + 1)
cursed 15 + (cwgt \times 2)

In addition to increasing the weight of its contents, a cursed bag of holding may make items vanish, with a separate 113 chance for each item each time you loot, apply or tip it.

A bag of holding will also protect its contents from being broken when thrown.

Exploding a bag of holding

A magical explosion will occur if certain items are put in a bag of holding, destroying all the contents of the bag and any other bags placed into it, along with the bag itself, and damaging the player. These items are as follows:[2]

The following information pertains to an upcoming version (3.7.0). If this version is now released, please verify that it is still accurate, then update the page to incorporate this information.

Per commit 71754910, exploding bags of holding scatter their contents rather than destroying them outright: fragile items are destroyed, and if caused by a bag of tricks, it is still lost along with the bag itself, while if caused by another bag of holding, that bag explodes as well per commit 9cdcf7b2. Per commit 6fd51c29, 113 of an exploded bag's contents are lost (not counting fragile items that are destroyed after), and per commit ce1f4788, monsters hit by scattered items are angered.

Strategy

Bags of holding are useful for carrying large numbers of items, and are an essential part of an ascension kit. While magically protecting its contents from breaking when thrown, a bag of holding does not stop them from getting wet - to protect against this, you can apply grease to the bag or place it in a non-cursed oilskin sack to protect it from water damage.

Item management

Due to the risks of losing your most valuable items if your bag is cursed or else explodes, many players also carry a plain sack to store other items. The sack can be used to hold items that are rare or hazardous to a bag of holding - many players name this bag something like "Cancel" or "Don't ever put this in BoH!" and keep wands of cancellation and other precious items such as artifacts or a wand of wishing inside as a safety measure.

You can also store a bag of holding in a sack, which prevents it from being targeted by curse items. However, it will require two turns to take items out of the bag of holding.

Handling cursed bags

If you find a bones pile with a bag of holding, it will probably be cursed and too heavy to lift. If you can still pick it up, then it can be uncursed with a potion of holy water or the scroll or spell of remove curse. Otherwise, the best solution in general is to zap it with a wand of cancellation - the beam will only affect the bag and simply sets its beatitude to uncursed. Be sure to move any wands and tools out of the way beforehand, along with any other desired items that you suspect may be enchanted or charged.

If cancellation is not available and the bag is too heavy to lift, you can #tip the bag - this will still make items vanish, but at least you can get everything else out without being limited by your inventory.

You can also allow a gelatinous cube to eat the bag if one is present: the cube will only eat the container itself, leaving the contents (including organic items) in its inventory, which will land safely on the ground when you kill the cube. Just make sure you can secure all the items before they are damaged - and only do this if you have no need for the bag itself.

Avoiding bag explosions

Placing a bag of holding or bag of tricks inside your bag of holding is straightforward to avoid, provided you don't type the wrong letter by mistake; the wand of cancellation can be trickier. To be safe, do not put any unidentified wands inside the bag, unless you have engrave-tested them and confirmed that they do not make engravings disappear - this rules out cancellation, along with teleportation and make invisible.

It is usually best to avoid carrying more than one bag of holding or any bag of tricks when they are not in use, except perhaps while transporting them to a convenient stash location - neither is particularly useful to simply carry around, and you can't put one inside your bag of holding by mistake if you don't have it. Many players prefer to leave wands of cancellation at their stash as well, but these can be useful against monsters, so one must balance the increased risk in combat with the risk of making a potential game-ending mistake.

Nesting bags of holding

It is possible, though risky, to first put items that would ordinarily cause a bag of holding to explode into sacks or oilskin sacks and then place them inside the bag of holding, without causing an explosion.

In general, two nested bags of holding at most are useful - the payload is limited by your ability to lift the innermost bag, not by the outermost weight, and you risk an explosion every time you add contents.

The chance of an explosion occurring then depends on the amount of nesting:[4]

Number of sacks Odds of explosion Success probability
0 1/1 0
1 2/2 0
2 3/4 0.25
3 4/8 0.5
4 5/16 0.6875
5 6/32 0.8125
6 7/64 0.890625
7 8/128 0.9375
8 9/128 0.9296875
n, where n>6 (n+1)/128

If they do not explode, the effect of the two bags will be cumulative, as expected: if both are blessed, any items in the innermost bag will have their weight reduced to about 1/16.

As can be seen in the table above, nesting bags of holding with more than 7 sacks in between makes explosion more likely, so there is no point in using more than 7 sacks.

You may choose to continue to nest the bags of holding further; the chance of success with certain configurations of sacks between the bags of holding is given below:

Number of bags of holding Sack spacing Success probability
2 7 0.9375
3 7,7 0.769042...
4 7,7,7 0.512570...
5 7,7,7,7 0.256222...
6 7,6,6,6,7 0.0935839...
7 7,6,5,5,6,7 0.0236287...
...
43 3,2,2, ... ,2 very small

For example, if you use 7 sacks between each of three bags of holding like this (H for bag of holding, s for sack): HsssssssHsssssssH (denoted as "7,7" in the table above), the chance of successful nesting would be 1-(8/128) for the first nesting, and then (1-(8/128)) * (1-(16/128)) for the second nesting; each of the two 'inner' bags of holding put into the outermost bag must pass its own independent roll for the nesting to succeed [5] - this gives the example scenario roughly a 23.1% chance that something will explode.

Some players either consider the 6.25% chance of explosion from nesting to be an acceptable risk, or assume from a test in wizard mode that it is safe. If you are confident you can withstand the explosion, you can risk it before you leave the main dungeon to increase your score or bring specific items to the demigod bar.[6]

History

The bag of holding first appears in NetHack 3.0.0.

From NetHack 3.3.0 to NetHack 3.4.3, including some variants based on those versions, Sokoban Level 4a always has a bag of holding as the prize.

Messages

An <object> has vanished!
You applied or #looted a cursed bag of holding, causing a known item(s) to disappear.[7]
You see <object> disappear!
As above, with an unidentified item(s) disappearing.[8]
As you put <object> inside, you are blasted by a magical explosion!
You caused a bag of holding to explode by placing a charged bag of tricks, charged wand of cancellation or another bag of holding inside, destroying both objects and their contents.[9]

Variants

SLASH'EM

In SLASH'EM, you can upgrade an ordinary sack or oilskin sack into a bag of holding. This typically makes the amulet of reflection found at the end of Sokoban a more valuable prize - there is still a 12 chance of each reward, even with the new levels introduced in the variant.

The Wallet of Perseus is an unaligned artifact bag of holding that has enhanced weight reduction, and enables you to informally identify a bag of holding via the 'naming artifacts' trick.

SLASH'EM has a 'showweight' option that explicitly displays the amount of weight your character is carrying - informally identifying bags of holding is trivial with this option turned on.

NetHack brass

In NetHack brass, Sokoban offers a choice between 3 items, with one being a bag of holding.

GruntHack

In GruntHack, causing a bag of holding to explode does not destroy the contents of the bag, but scatters them and the player throughout the dungeon via level teleport.

Sokoban in GruntHack also offers a choice between 3 prizes, with one being a guaranteed bag of holding.

SporkHack

In SporkHack, an exploding bag of holding scatters its contents nearby, rather than destroying them outright - this will still destroy the inserted object, and fragile objects such as potions and mirrors are broken as if they were thrown.

UnNetHack

In UnNetHack, exploding bags of holding react the same as in SporkHack, scattering most of its contents and destroying fragile items.

Sokoban in UnNetHack offers a choice between 3 prizes, with one being a guaranteed bag of holding.

AceHack

In AceHack, inserting a bag of tricks or a wand of cancellation inside a bag of holding will drain them of their charges rather than destroying any items inside - you can still destroy bags of holding by nesting them, but you will receive a confirmation prompt when doing so. This also applies to NetHack 4, a 'successor' variant to AceHack.

NetHack Fourk

In NetHack Fourk, Sokoban now has set rewards for each of the possible maps that can appear as its final floor. Open at the Top, which is essentially a clone of Sokoban level 4a, always has a bag of holding as its prize.

xNetHack

In xNetHack, an exploding bag of holding behaves as in SporkHack and some other variants: 113 of the contents are destroyed along with the bag and inserted item, and the rest are scattered, destroying fragile items.

EvilHack

In EvilHack, an exploding bag of holding functions as in SporkHack and some other variants: 113 of the contents are destroyed along with the bag and inserted item, and the rest are scattered, destroying fragile items.

Sokoban in EvilHack offers 3 different type of prize item, and its prize tool has a 12 chance of being a bag of holding.

The Bag of the Hesperides is an artifact bag of holding similar to the Wallet of Perseus that repels water like an oilskin sack, confers protection when carried, and is made of inherently fireproof dragonhide - it can only be obtained at the end of the Ice Queen's Realm.

Hack'EM

In Hack'EM, bags of holding behave as in EvilHack. The Wallet of Perseus also possesses most of the same traits as the Bag of the Hesperides from EvilHack, minus the location.

Encyclopedia entry

"Now, this third handkerchief," Mein Herr proceeded, "has also four edges, which you can trace continuously round and round: all you need do is to join its four edges to the four edges of the opening. The Purse is then complete, and its outer surface--"
"I see!" Lady Muriel eagerly interrupted. "Its outer surface will be continuous with its inner surface! But it will take time. I'll sew it up after tea." She laid aside the bag, and resumed her cup of tea. "But why do you call it Fortunatus's Purse, Mein Herr?"
The dear old man beamed upon her, with a jolly smile, looking more exactly like the Professor than ever. "Don't you see, my child--I should say Miladi? Whatever is inside that Purse, is outside it; and whatever is outside it, is inside it. So you have all the wealth of the world in that leetle Purse!"

[ Sylvie and Bruno Concluded, by Lewis Carroll ]

References