Spelunky is © 2008, 2009 Derek Yu and Mossmouth, LLC, and is used under the [Spelunky User License v1.1b](https://spelunky.ai/LICENSE.txt). spelunky.ai is an unofficial fan project, not affiliated with or endorsed by Mossmouth. The game and its assets may not be sold.

Music by George Buzinkai and Jonathan Perry; sound effects made in SFXR. From Spelunky Classic 1.1, © 2008, 2009 Derek Yu and Mossmouth, LLC.

# Locked Chest

From the spelunky.ai wiki: <https://spelunky.ai/wiki/locked-chest>.

This page describes a secret.

*For the chest of gems, see [Chest](https://spelunky.ai/wiki/chest).*

The Locked Chest is a carryable item in Spelunky Classic, on one of the Mines' levels 2 to 4, that opens on the Udjat Eye when the player carries its Key to it.

![A wooden chest with a big gold padlock on its front](https://spelunky.ai/wiki/media/sprites/sLockedChest/frames/0%404x.png)

| Locked Chest |                                                                                   |
| ------------ | --------------------------------------------------------------------------------- |
| Kind         | Carryable                                                                         |
| Effect       | Opens on the Udjat Eye, with its key[^1]                                          |
| Objects      | `oLockedChest`, `oKey`                                                            |
| Found in     | [The Mines](https://spelunky.ai/wiki/mines) (On level 2, 3 or 4, once a game)[^2] |

The Locked Chest and its Key are made on the same level, the one level of the [Mines](https://spelunky.ai/wiki/mines) that holds the
[Udjat Eye](https://spelunky.ai/wiki/udjat-eye): the chest in a nook in the rock, and the Key in place of one of the level's treasures.
Carrying the Key to the chest opens it, and the Eye pops out. Unlike a [Chest](https://spelunky.ai/wiki/chest), it can't be opened with
up and the attack key, and it never holds a bomb.

## Usage

**Clip: Key to the locked chest.** The player picks up a key lying on a ledge as a bomb he dropped by the entrance blows open the way down. He carries the key back and down to the locked chest without letting go; as it touches the chest, the chest and the key vanish in two puffs of smoke and the Udjat Eye pops out. ([video](https://spelunky.ai/wiki/media/clips/locked-chest/key/clip.mp4))

The Key is picked up and thrown as any item is ([Throwing](https://spelunky.ai/wiki/throwing)): crouching over it with empty hands, the attack
key lifts it, and while he holds it, it points the way he faces[^3][^4]. When the Key touches the chest while the player is holding it, the chest
opens: the Key leaves his hands and is used up, the chest plays its opening sound, and the Udjat Eye pops out
of it, up at 2 pixels a step and across at up to 3 either way, as the chest vanishes between two puffs of
smoke[^1]. Picking up the Eye puts it on ([Udjat Eye](https://spelunky.ai/wiki/udjat-eye#effect)).
A Key that touches the chest without being held, thrown at it or lying beside it, does nothing[^5][^6].

In the clip, the player picks up the Key from a ledge as a bomb he dropped by the entrance blows open the
way down, and carries it down to the chest without letting go: the chest opens as the Key touches it, and the
Eye pops out[^7][^8].

The chest is heavy, like a [Crate](https://spelunky.ai/wiki/crate): the player can pick it up and carry it higher than other items,
and throws it at 4 pixels a step plus his own speed, rising at 2, or at 4 upward[^9][^10][^11]. He can't hold the chest and the Key at once, and the chest opens
only to the Key in his hands, so it's the Key that has to be carried to the chest. Either of them, thrown faster than 2 pixels a step into a
monster, takes 1 hit point from the monster nearest it, as any thrown item does[^12].

## Locations

The level that makes them is level 2 one time in 3, level 3 one time in 2, and otherwise level 4: the roll is
made on each of those levels until one has made the Key[^2][^13]. On it:

- **The chest** goes in a nook, a space one block high with rock above it and a wall beside it. Each nook
  that gets no [Web](https://spelunky.ai/wiki/web) rolls for it, at 1 in 8 for the first and one
  likelier for each that fails, so by the eighth nook it's certain[^14]. If no nook takes it, it goes beside the exit instead: on
  its left if that's open, else on its right, else on the exit[^15].
- **The Key** takes the place of one of the level's treasures (gems, gold) that isn't inside a block. Each
  takes a roll of 1 in 8, for up to seven passes over them, and if none wins, the first of them is taken[^16]. Only the Key's making ends the rolls for later levels: a
  level with no treasure lying in the open would make the chest and no Key, and the next of levels 3 and 4
  would roll again[^13][^17].

The Key can be anywhere in the level, and sometimes in a pocket of rock that nothing leads into
([The Udjat Eye's key sealed in rock](https://spelunky.ai/wiki/udjat-key-sealed)), the chest with it at times, which a [Bomb](https://spelunky.ai/wiki/bomb) or the [Mattock](https://spelunky.ai/wiki/mattock) has to break
open[^6]. In the second clip, two bombs have
opened such a pocket, and the player crawls the Key under the low rock to the chest inside[^18].

**Clip: Key sealed in rock.** Bombs have opened a pocket of rock holding a locked chest and its key. An arrow trap fires over the player as he drops in; he picks up the key, crawls under the low rock to the chest, opens it and puts on the Udjat Eye. ([video](https://spelunky.ai/wiki/media/clips/udjat-eye/sealed-key/clip.mp4))

No shop sells either, and the [level editor](https://spelunky.ai/wiki/level-editor) has no tile for them.

## Interactions

- **Exits.** The Key isn't heavy, so carried through a level's exit it's in the player's hands on the next
  level, and drawn with him on the screen between levels, the HUD showing it in the box for the held item[^19][^20][^21][^22]. It opens nothing there:
  no later level makes a chest[^23]. The chest is heavy, and the player
  sets it down at the exit, so it stays on its level[^24].
- **[Bombs](https://spelunky.ai/wiki/bomb).** An explosion throws the chest and the Key away from it without breaking either[^25].
- **[Lava](https://spelunky.ai/wiki/lava).** Either one that touches lava stops and sinks, and is destroyed once it's under the
  surface[^26]; the Key lost there is the Eye lost for the game.

## Tips

- The Key is always one of the level's loose treasures, so on a level with a locked chest, a key lying where a
  gem or gold would be is the one.
- Keep the Key in hand all the way: only a held Key opens the chest.
- A Key lost in lava or left behind can't be replaced: no later level makes another chest or key.

## Trivia

- Opening the chest switches it to its open sprite, and then destroys it in the same step, so the open chest
  is never drawn: the Eye comes out between two puffs of smoke instead[^27].
- A commented-out line in the game's drawing code would have shown the player's distance to the chest above
  his head[^28].

## FAQ

### How do you open the locked chest in Spelunky Classic?

With its Key, held. The same level turns one of its treasures into a Key; the player picks it up and carries it to the chest, and the chest opens as the Key touches it, using the Key up. A Key thrown at the chest, or lying beside it, doesn't open it.

### Where is the key to the locked chest in Spelunky Classic?

In place of one of the same level's treasures: a gem or gold lying in the open, not one inside a block, picked at random. It can be anywhere in the level, sometimes in a pocket of rock that has to be broken open ([The Udjat Eye's key sealed in rock](https://spelunky.ai/wiki/udjat-key-sealed)).

### What's in the locked chest in Spelunky Classic?

The [Udjat Eye](https://spelunky.ai/wiki/udjat-eye), always. Picking it up puts it on: it shows buried treasure, and beeps near the [Black Market](https://spelunky.ai/wiki/black-market)'s hidden entrance.

### Can you carry the key to another level in Spelunky Classic?

Yes, but it opens nothing there. Once a level has made the Key, no later level in that game makes another locked chest.

## See also

- **Drops:** [Udjat Eye](https://spelunky.ai/wiki/udjat-eye)
- **Related:** [Chest](https://spelunky.ai/wiki/chest), [Crate](https://spelunky.ai/wiki/crate), [Reaching the Black Market](https://spelunky.ai/wiki/black-market-route), [The Udjat Eye's key sealed in rock](https://spelunky.ai/wiki/udjat-key-sealed)
- **Damages:** [Damsel](https://spelunky.ai/wiki/damsel)

## References

[^1]: [`objects/oLockedChest/collision_oKey.gml:1-21`](https://spelunky.ai/wiki/source/objects/oLockedChest/collision_oKey#L1-L21)

[^2]: [`scripts/scrInitLevel.gml:178-184`](https://spelunky.ai/wiki/source/scripts/scrInitLevel#L178-L184)

[^3]: [`objects/oPlayer1/step.gml:1203-1214`](https://spelunky.ai/wiki/source/objects/oPlayer1/step#L1203-L1214)

[^4]: [`objects/oKey/step.gml:3-7`](https://spelunky.ai/wiki/source/objects/oKey/step#L3-L7)

[^5]: [`objects/oLockedChest/collision_oKey.gml:1`](https://spelunky.ai/wiki/source/objects/oLockedChest/collision_oKey#L1)

[^6]: [“The locked chest's key can be sealed in rock.”](https://spelunky.ai/wiki/udjat-key-sealed), [docs/quirks.md §1](https://github.com/851-labs/spelunky/blob/441458fcee127d2a4bff9d1cb9b930574f50004a/docs/quirks.md?plain=1#L67)

[^7]: Clip [locked-chest/key](https://spelunky.ai/wiki/locked-chest#clip-locked-chest-key)

[^8]: Replay [`fidelity/replays/item-seed-35-udjat-eye.txt`](https://github.com/851-labs/spelunky/blob/441458fcee127d2a4bff9d1cb9b930574f50004a/fidelity/replays/item-seed-35-udjat-eye.txt), which the clip [Key to the locked chest](https://spelunky.ai/wiki/locked-chest#clip-locked-chest-key) plays

[^9]: [`objects/oLockedChest/create.gml:7`](https://spelunky.ai/wiki/source/objects/oLockedChest/create#L7)

[^10]: [`objects/oItem/step.gml:44-56`](https://spelunky.ai/wiki/source/objects/oItem/step#L44-L56)

[^11]: [`scripts/scrUseItem.gml:609-635`](https://spelunky.ai/wiki/source/scripts/scrUseItem#L609-L635)

[^12]: [`objects/oItem/step.gml:256-350`](https://spelunky.ai/wiki/source/objects/oItem/step#L256-L350)

[^13]: [`scripts/scrEntityGen.gml:143`](https://spelunky.ai/wiki/source/scripts/scrEntityGen#L143)

[^14]: [`scripts/scrTreasureGen.gml:47-64`](https://spelunky.ai/wiki/source/scripts/scrTreasureGen#L47-L64)

[^15]: [`scripts/scrEntityGen.gml:76-106`](https://spelunky.ai/wiki/source/scripts/scrEntityGen#L76-L106)

[^16]: [`scripts/scrEntityGen.gml:108-141`](https://spelunky.ai/wiki/source/scripts/scrEntityGen#L108-L141)

[^17]: [`scripts/scrInitLevel.gml:179-184`](https://spelunky.ai/wiki/source/scripts/scrInitLevel#L179-L184)

[^18]: Clip [udjat-eye/sealed-key](https://spelunky.ai/wiki/locked-chest#clip-udjat-eye-sealed-key)

[^19]: [`objects/oPlayer1/step.gml:842-850`](https://spelunky.ai/wiki/source/objects/oPlayer1/step#L842-L850)

[^20]: [`scripts/scrHoldItem.gml:50`](https://spelunky.ai/wiki/source/scripts/scrHoldItem#L50)

[^21]: [`objects/oPDummy/draw.gml:37`](https://spelunky.ai/wiki/source/objects/oPDummy/draw#L37)

[^22]: [`scripts/scrDrawHUD.gml:96`](https://spelunky.ai/wiki/source/scripts/scrDrawHUD#L96)

[^23]: [`scripts/scrInitLevel.gml:179`](https://spelunky.ai/wiki/source/scripts/scrInitLevel#L179)

[^24]: [`objects/oPlayer1/step.gml:815-820`](https://spelunky.ai/wiki/source/objects/oPlayer1/step#L815-L820)

[^25]: [`objects/oExplosion/collision_oItem.gml:30-36`](https://spelunky.ai/wiki/source/objects/oExplosion/collision_oItem#L30-L36)

[^26]: [`objects/oItem/step.gml:160-185`](https://spelunky.ai/wiki/source/objects/oItem/step#L160-L185)

[^27]: [`objects/oLockedChest/collision_oKey.gml:11-20`](https://spelunky.ai/wiki/source/objects/oLockedChest/collision_oKey#L11-L20)

[^28]: [`objects/oGame/draw.gml:166`](https://spelunky.ai/wiki/source/objects/oGame/draw#L166)

### Source code

- [`objects/oLockedChest/create.gml`](https://spelunky.ai/wiki/source/objects/oLockedChest/create)
- [`objects/oLockedChest/collision_oKey.gml`](https://spelunky.ai/wiki/source/objects/oLockedChest/collision_oKey)
- [`objects/oKey/create.gml`](https://spelunky.ai/wiki/source/objects/oKey/create)
- [`objects/oKey/step.gml`](https://spelunky.ai/wiki/source/objects/oKey/step)
- [`scripts/scrInitLevel.gml`](https://spelunky.ai/wiki/source/scripts/scrInitLevel)
- [`scripts/scrEntityGen.gml`](https://spelunky.ai/wiki/source/scripts/scrEntityGen)
- [`scripts/scrTreasureGen.gml`](https://spelunky.ai/wiki/source/scripts/scrTreasureGen)
