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:
- large box (lockable)
- chest (lockable)
- ice box
- sack
- oilskin sack
- bag of holding
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.
Description
Containers can store an unlimited number of items, and have a few commands associated with them:
- The #loot extended commands is used to look inside a container on the player character's square, and they can add and/or remove contents, including stashing a singular item (or stack of items).
- The #tip command is used to dump the contents of a container in the character's inventory or on their square, which deposits them all on the ground at their square.
- A container in the character's inventory is used by applying it.
Some containers can be locked, requiring an unlocking tool, the wand of opening, or the spell of knock in order to open, and lockable containers 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 many forms of damage, with the exact level of protection depending on the specific container: a container generally protects contents from 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.Generation
Containers created via normal generation, i.e. outside of bones files or trap "bones", are uncursed, with the contents as described below:
Containers will not be generated containing tools, weapons, armor, or rocks. Containers in your starting inventory will be empty.
If the container can be locked, then there is an 80% chance that it will be generated locked and, independently, a 10% chance that it will be trapped.
Container | Contents | Lockable | Probability |
---|---|---|---|
sack | 0–1 items | No | 3.5% |
large box | 0–3 items | Yes | 4.0% |
chest | 0–5 items | Yes | 3.5% |
ice box | 0–20 corpses | No | 0.5% |
bag of holding | 0–1 items | No | 2.0% |
bag of tricks | 1–20 charges | No | 2.0% |
oilskin sack | 0–1 items | No | 0.5% |
Tools can be generated in the main dungeon (8% of all objects) and Gehennom (12% of all objects). Each tool has the given probability of being a container.
Items generated in a container (other than an ice box) will each be one of the following types:
Type | Probability |
---|---|
gem or stone | 18% |
comestible | 15% |
potion | 18% |
scroll | 18% |
spellbook | 12% |
gold | 7% |
wand | 6% |
ring | 5% |
amulet | 1% |
Weapons, armor, and tools (including other containers) will never be generated in a container. Gold generated in containers will be 2.5 times the usual amount. Gemstones, glass, luckstones, and loadstones can all be generated, but flint stones, touchstones, and rocks cannot. A wand of cancellation will never be generated in a bag of holding.
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.[1] (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 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.