Container
A container is a type of tool that appears in NetHack, and is designed for the purpose of storing and removing items.
Contents
List of containers
The following items are considered containers:
Although the bag of tricks appears as a "bag", it cannot actually store items. Statues, floor squares and ice squares can contain items, but are not considered containers.
Generation
Containers created via normal generation (i.e. outside of bones files or trap "bones") are always uncursed and may contain the following quantities of items:
Container | Contents | Lockable |
---|---|---|
sack | 0–1 items | No |
large box | 0–3 items | Yes |
chest | 0–5 items | Yes |
ice box | 0–20 corpses | No |
bag of holding | 0–1 items | No |
oilskin sack | 0–1 items | No |
Containers in the hero's starting inventory will always be empty. Otherwise, for containers other than the ice box, each of the items in randomly generated containers are created with the following probabilities:
Type | Probability |
---|---|
gem or stone[1] | 18% |
comestible | 15% |
potion | 18% |
scroll | 18% |
spellbook | 12% |
gold (2.5x normal amount) | 7% |
wand[2] | 6% |
ring | 5% |
amulet | 1% |
Containers that can be locked have a 4⁄5 chance of generating as locked, and a separate 1⁄10 chance of generating with a container trap.[3]
Description
Containers can store an unlimited number of items. Containers on the ground can be opened with the #loot extended command, which is used to view a container's contents and add and/or remove items, including stashing a singular item (or stack of items); they can also be emptied with the #tip command, which will dump the contents onto the ground at the character's square. A container in the character's inventory is used by applying it, which works the same as looting, and can also be tipped to deposit its contents on the ground. Tipping a container while levitating will cause fragile items to break.
Large boxes and chests can be locked, requiring an unlocking tool, the wand of opening, or the spell of knock in order to open, and may also have a container trap hidden on them, which will trigger if the box is opened, locked, unlocked, or else the character fails an untrap attempt. It is possible to force a locked container and break the lock open, though this comes with risks: Forcing the lock with a bladed weapon exercises dexterity, but risks breaking that weapon unless it is cursed, while forcing the lock with a blunt weapon exercises strength, but may destroy the container and possibly some or all of its contents. Kicking a container can break open locks if applicable, but can also destroy items inside the container, particularly fragile ones. A broken lock can be repaired with the wand of locking or the spell of wizard lock.
The contents of containers are protected from certain forms of damage, with the exact level of protection depending on the specific container: a container generally prevents its contents being affected by fire, cold, shock, or cancellation. Magical containers (i.e. the bag of holding) also protect their contents from being destroyed if the bag is kicked, thrown, being dropped down stairs, or being dropped while levitating. If a container is polymorphed, its contents are lost.
There are limitations to what can be placed in a container:
- Unique items cannot ever be placed into containers.
- Large boxes, ice boxes, and chests are too big to fit into any other container.
- Placing certain items in a bag of holding will cause it to explode and destroy any items within - see the article on the bag of holding for specific details.
Monsters will not access the contents of containers directly, with one notable exception: a gelatinous cube that engulfs a container made of an organic material (i.e. all except the ice box) will eat the container, destroying it and harmlessly engulfing the contents regardless of whether it would eat those items normally. A character polymorphed into a gelatinous cube can only eat these containers if they are empty.
The following information pertains to an upcoming version (NetHack 3.7.0). If this version is now released, please verify that the information below is still accurate, then update the page to incorporate it.
Monsters can loot containers and will use unlocking tools to open locked containers.History
Prior to NetHack 3.2.0, a popular technique for identifying worthless glass was called "kickboxing". One would gather a large pile of gems, name all of them "fake red" or whatever color, dump them in a box, and then repeatedly kick the box until no more muffled shatters were heard. One would then retrieve the remaining gems and un-name them. In this way, glass of all colors could be identified. Starting with NetHack 3.2.0, worthless glass no longer breaks, so kickboxing no longer works.
Messages
- You hear a muffled shatter.
- You kicked or threw a container and broke at least one item inside it.
- You hear a muffled cracking.
- As above, and at least one egg inside was destroyed.
- That would be an interesting topological exercise.
- You attempted to place a container inside itself.
Variants
Some variants of NetHack add new containers, while others may change how certain containers function. The magic chest is a common addition to many variants, with each one implementing it differently.
SporkHack
SporkHack introduces the iron safe, which is an iron container that can only be locked and unlocked by magic or stethoscope.
Magic chest
In DynaHack, magic chests are dungeon features (not items) that are generated at fixed places in the dungeon. They share their contents, so putting items in any magic chest makes them available for looting in all other magic chest locations.[4] (See below for FIQHack's magic chests.)
In NetHack Fourk, magic chests have some items inside when you first open one, randomized but suited for your role. Also, you can create a magic chest in any location by reading a scroll of consecration while confused.
In dNetHack, magic chests are items rather than dungeon features, and they have 10 slots for different compartments for those willing to categorize items. All of the compartments are shared similarly across all chests. As items, they can be wished for. They weigh 1001 aum, and bolt to the floor when opened, meaning they cannot be carried around as an infinite weight container. When bolted to the floor, they cannot be picked up. The only way to unbolt them is the Master Key of Thievery's untrapping invoke.
In EvilHack, magic chests are implemented as dungeon features similarly to DynaHack, and are generated at fixed locations in the dungeon - there are also special keys that are required to lock and unlock the chest.
FIQHack
FIQHack has magic chests, similar to DynaHack or Nethack Fourk. They are objects but they behave like dungeon features - they can't be picked up, teleported, polymorphed, etc. You can create a magic chest by wishing for one. Minetown, Sokoban, the Castle, Orcus-town, and the quest home all have magic chests.
Also note that monsters in FIQHack can use containers - they can carry items in bags and loot items from containers on the floor. The Castle chest is special-cased to prevent monsters from stealing the guaranteed wand of wishing.
References
- ↑ This excludes flint stones, touchstones, and rocks.
- ↑ A wand of cancellation will never be generated in a bag of holding.
- ↑ src/mkobj.c in NetHack 3.6.7, line 921
- ↑ https://github.com/tung/DynaHack/commit/b97d99ed27123fa0717ef8368b4f0d49d815c2c8
This page may need to be updated for the current version of NetHack.
It may contain text specific to NetHack 3.6.0. Information on this page may be out of date.
Editors: After reviewing this page and making necessary edits, please change the {{nethack-360}} tag to the current version's tag or {{noversion}} as appropriate.