Jar
Verified against the spelunky.ai port v0.1.10 on .
The Jar is a carryable item in Spelunky Classic that breaks when it's thrown, whipped or dropped hard, sometimes letting out gold, a gem, a Spider or a Snake.
It's carried and thrown like a Rock, but it breaks on whatever it hits hard, and a broken Jar sometimes has something in it: gold, a big gem, or a monster. Level generation leaves Jars lying in every area, and they have movement code of their own, which makes them fall and bounce a little differently from other items.
Usage
#A Jar is picked up and thrown as any item is: crouching over it with empty hands and pressing the attack key lifts it, and the attack key throws it, at 8 pixels a step plus the player's speed, or up, or low along the floor [3] [4]. Its own code moves it: it falls 0.6 pixels a step faster each step until it's falling at 6 or more, and bounces off walls and floors as a Rock does [5]. It breaks when it:
- hits a ceiling going up faster than 3 pixels a step, hits a wall faster than 3 across, or lands faster than 3 [6];
- ends up inside a block [7];
- touches a monster or a Damsel while moving faster than 2 pixels a step [8];
- is hit by the Whip's crack (or a Machete's slash or a Mattock's hit, which the game counts as kinds of whip), a bullet or an explosion, or sinks into lava [9] [10] [11] [12].
Breaking, it shatters into three pieces and rolls once for what's inside, each roll made only if the ones before it fail [13]:
| Contents | Chance | |
|---|---|---|
| A Gold Chunk | 1 in 3 | [14] |
| A Gold Nugget | 1 in 6 | [15] |
| A Big Emerald | 1 in 12 | [16] |
| A Big Sapphire | 1 in 12 | [17] |
| A Big Ruby | 1 in 12 | [18] |
| A Spider | 1 in 6 | [19] |
| A Snake | 1 in 12 | [20] |
| Nothing | Otherwise |
In the clip, the player throws a Jar at a Snake: the Jar shatters on it and the Snake dies [21].
Thrown at monsters
#The Jar's own code decides what it does to a monster, and it isn't the code other thrown items share [22]. It picks the monster nearest it, as they do [23], and unless that one is invincible:
| Monster | What it does | |
|---|---|---|
| Caveman, Hawkman, Mantrap, Yeti, Shopkeeper | Stuns it, taking nothing; nothing while it's stunned | [24] |
| Any other, the Vampire, Magma Man and UFO included | 1 hit point, without stunning it | [25] |
Either way, the monster takes three tenths of the Jar's speed, and the Jar breaks, on an invincible monster too [26]. A UFO that loses its hit point becomes a falling wreck, as from a bullet, rather than blowing up as it does for a Rock [27].
Locations
#- Level generation, in every area: on each block that could have a Rock (outside shops, with open space above, away from the entrance, the exit and a golden idol), a 1 in 40 chance, once the Rock's 1 in 100 fails [28].
- The level editor's
jtile [29].
The Jungle's graveyard room with the crystal skull has four tiles that the code means to make rising bones or a Jar, but its test is always true, so they're always bones [30] [23].
Interactions
#- Whip. The crack breaks a Jar, and its code rolls for the contents, then destroys the Jar, which rolls again: a whipped Jar gets two rolls, and can let out two things, as does one a Machete or a Mattock breaks [31] [13]. In the clip, one Jar lets out a big emerald and a gold chunk [32]. The wind-up behind the player doesn't break one.
- Pitcher's Mitt. A Jar thrown with it keeps the Mitt's lighter gravity for good, as its own code only changes gravity in lava, so it flies far and flat [23].
- The screen. Most items stop once they're 16 pixels off the screen; a Jar's code has no such test, so it keeps moving until the level puts everything far off the screen to sleep [33] [34].
- Exits. Carried through a level's exit, it's in the player's hands on the next level, whole: the old one is removed without breaking [35].
Tips
#- A Jar breaks on the first monster it touches, so each one is a single shot; a Rock can be thrown again.
- A Jar only stuns a Caveman, a Hawkman, a Mantrap or a Yeti, where a Rock also takes a hit point.
- Whipping a Jar gives two chances at what's inside, where throwing it gives one.
Trivia
#- The Jar's movement code is a copy of the shared item code's, and keeps lines that only matter for other items: a Bomb exploding in lava, and an arrow being destroyed when it hits a monster [36] [37].
FAQ
#- What's inside a Jar in Spelunky Classic?
Often nothing. A broken Jar rolls once: a 1 in 3 chance of a gold chunk, and, as each roll before fails, a gold nugget, a big emerald, a big sapphire, a big ruby, a Spider or a Snake. A Jar broken by the Whip rolls twice.
- How do you break a Jar in Spelunky Classic?
Throw it hard at a wall, the floor, the ceiling or a monster, crack the Whip at it (or swing a Machete or a Mattock), shoot it, or blow it up.
- Does a thrown Jar hurt monsters in Spelunky Classic?
Yes: 1 hit point to most, and the Jar breaks on it. A Caveman, a Hawkman, a Mantrap, a Yeti or a Shopkeeper is only stunned by it, losing nothing.
- Are there pots in Spelunky Classic?
Not by that name: the Jar is the game's only breakable pot. It's found lying on the ground in every area.
Gallery
#See also
#References
#objects/oJar/destroy.gml:17-28objects/oJar/step.gml:134objects/oPlayer1/step.gml:1203-1214scripts/scrUseItem.gml:605-646objects/oJar/step.gml:23-79objects/oJar/step.gml:37-53objects/oJar/step.gml:49objects/oJar/step.gml:106-172objects/oJar/collision_oWhip.gml:1-21objects/oJar/collision_oBullet.gml:1objects/oExplosion/collision_oItem.gml:1-5objects/oJar/step.gml:83-103objects/oJar/destroy.gml:3-28objects/oJar/destroy.gml:17objects/oJar/destroy.gml:18objects/oJar/destroy.gml:19objects/oJar/destroy.gml:20objects/oJar/destroy.gml:21objects/oJar/destroy.gml:22objects/oJar/destroy.gml:23-28- Clip jar/throw
objects/oJar/step.gml:106-148- Quirk 1 (docs/quirks.md)
objects/oJar/step.gml:114-130objects/oJar/step.gml:131-139objects/oJar/step.gml:139-147objects/oUFO/step.gml:6-16scripts/scrTreasureGen.gml:44-45scripts/scrCreateTileObj.gml:118-121scripts/scrRoomGen2.gml:490-494objects/oJar/collision_oWhip.gml:9-21- Clip jar/whip
objects/oJar/step.gml:1-25objects/oLevel/step.gml:65-77objects/oPlayer1/step.gml:842-850objects/oJar/step.gml:90-103objects/oJar/step.gml:143-144
Source code
objects/oJar/create.gmlobjects/oJar/step.gmlobjects/oJar/destroy.gmlobjects/oJar/collision_oWhip.gmlobjects/oJar/collision_oBullet.gmlobjects/oPlayer1/step.gmlscripts/scrUseItem.gmlscripts/scrTreasureGen.gml