# Iron bars

Dungeon features

&nbsp;&nbsp;Air

_&nbsp;Altar

#&nbsp;Corridor

#&nbsp;Cloud

#.&nbsp;Drawbridge

+-|&nbsp;Door

.&nbsp;Doorway

{&nbsp;Fountain

|&nbsp;Headstone

.&nbsp;&nbsp;Floor

&gt;&lt;&nbsp;Ladder

.&nbsp;Ice

#&nbsp;Iron&nbsp;bars

}&nbsp;Lava

}&nbsp;Moat

#&nbsp;Sink

&nbsp;&nbsp;Solid&nbsp;rock

&gt;&lt;&nbsp;Staircase

\&nbsp;Throne

^"&nbsp;Trap

#&nbsp;Tree

-&nbsp;|&nbsp;Wall

~&nbsp;Vibrating square

Iron bars are a dungeon feature that appear in NetHack, represented by #.

Contents

1 Generation
2 Description
3 Strategy
4 History
5 Variants

5.1 SLASH'EM
5.2 UnNetHack
5.3 SporkHack
5.4 dNetHack

6 References

Generation
Randomly generated inaccessible closets (that have a guaranteed scroll of teleportation) have a 20% chance of having iron bars where the door would be.
Iron bars also appear in the following branches and special levels:

The Minetown variant Orcish Town will also have several iron bars blocking off entrance into the ruined town.
There are guaranteed iron bars in the Wizard, Tourist, and Ranger quests.
The Big Room has a wall of iron bars in the middle or the map for #8, and there is a chance of iron bars being selected as the terrain for maps of #1 and #10.
The fourth snake-filled variant of Medusa's Island has some iron bars around Medusa's dwelling.
Description
Iron bars cannot be dug through, and objects thrown through them have a chance of being stopped by the iron bars. Specifically, large objects such as most melee weapons, most armor or boulders will always be stopped - smaller objects such as potions and most projectiles (including spears, but not daggers or boomerangs) will pass through with 80% chance, or 100% if the monster throwing them is next to the bars in question.[1][2] Spells, rays and beam attacks - such as dragon breath - will pass right through them.
All monsters that are whirly, amorphous, phasing, tiny, or else medium-sized (or smaller) and slithy can pass through them, including you if you have any of these properties or polymorph into a monster that does).[3] Monsters with rusting or corrosive attacks, such as rust monsters and gray oozes, can also eat through the bars.
Acid can be used to dissolve iron bars: a potion of acid smashed onto them by using F while wielding it, or thrown at them – as noted above, a thrown potion potion only has a 20% chance of hitting the bars.[4][5] The acidic breath of a yellow dragon will dissolve the bars as well.[6] Bars that are marked "non-diggable" cannot be dissolved by any of these methods.

Strategy
Iron bars do not impede visibility, allowing spellcasting or wand-using players and monsters to direct their beams, rays and gazes through them. In particular, this can be used to pick off Orcish Town's invaders without as much immediately risk to yourself - but beware of the poisoned arrows that many of them can fire back at you, especially if you lack poison resistance.
The iron bars on the fourth variant of Medusa's Island present a significant hazard, however - you may inadvertently catch a glimpse of Medusa through the bars as you approach her, depending on where she is first generated, and risk being immediately petrified. Wearing a blindfold or towel before approaching may therefore be a good idea, especially if you lack reflection.

History
Iron bars first appear in NetHack 3.1.0, when the Quest was introduced to the game.
In version 3.4.0, a potential bug occurred with whirly and/or amorphous engulfers passing through iron bars while engulfing a monster that cannot.
NetHack 3.6.0 was the first version in which iron bars can randomly generate through the previously discussed method, and the first in which monsters could eat through them; dissolving iron bars with acid was added in 3.6.1.

A user has suggested improving this page or section as follows:
"Is the 3.4 bug still valid for 3.6.0?"

Variants
SLASH'EM
In SLASH'EM, iron bars may be found in some of the new levels of Sokoban, and also appear in Grund's Stronghold. Some maze levels within the dungeon may be partially comprised of iron bars, e.g. in Gehennom; these can prove especially annoying during the ascension run.
In addition to the applicable methods described above, player Dopplegangers can use the liquid leap technique to pass through them. This can even be used on the iron bars in Sokoban, which otherwise prevents creatures from passing through them.

UnNetHack
In UnNetHack, as in SLASH'EM above, iron bars appear in some of the new levels of Sokoban (a few of which are from SLASH'EM) and in Gehennom mazes. They also appear much more frequently within the main dungeon, often replacing doorways and sections of rock wall within room-and-corridor levels.
A ring of iron bars is created around the magic portal connecting the Black Market to the main dungeon if you attempt to steal anything from their shops.
Iron bars may be eaten by metallivores, and may also dissolved by acid breath from dragons (with a 20% chance)or a potion of acid.[7] [8][9][10]

SporkHack
In SporkHack, iron bars are sometimes generated as part of room-and-corridor dungeon levels.

dNetHack
In dNetHack, iron bars can be broken with a wand of striking.

References

↑ hit_bars in mthrowu.c

↑ src/mthrowu.c in NetHack 3.6.6, line 472

↑ passes_bars in mondata.c

↑ src/hack.c in NetHack 3.6.6, line 1632

↑ src/mthrowu.c in NetHack 3.6.6, line 1136

↑ src/zap.c in NetHack 3.6.6, line 4567

↑ src/zap.c in UnNetHack revision 1499, line 3915

↑ src/mthrowu.c in UnNetHack revision 1499, line 856

↑ src/hack.c in UnNetHack revision 1499, line 731

↑ src/monmove.c in UnNetHack revision 1499, line 1307