SpelunkyFan wiki

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

#
Clip not rendered yet
Jar thrown at a snake. The player picks up a jar, drops down a level and throws it at a snake on the floor. The jar shatters on the snake and kills it.

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]:

ContentsChance
A Gold Chunk1 in 3[14]
A Gold Nugget1 in 6[15]
A Big Emerald1 in 12[16]
A Big Sapphire1 in 12[17]
A Big Ruby1 in 12[18]
A Spider1 in 6[19]
A Snake1 in 12[20]
NothingOtherwise

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:

MonsterWhat it does
Caveman, Hawkman, Mantrap, Yeti, ShopkeeperStuns it, taking nothing; nothing while it's stunned[24]
Any other, the Vampire, Magma Man and UFO included1 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 j tile [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

#
Clip not rendered yet
Jar whipped open. The player cracks the whip at a jar beside him. It shatters into pieces and lets out a big emerald and a gold chunk, which he walks over and collects.
  • 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.

#
The Pitcher's Mitt's light gravity lasts one step for a rock. Wearing a pitcher's mitt, the player throws a rock straight ahead: it drops to the floor within a few steps and stops short. He throws a jar the same way: it keeps the mitt's light gravity and flies flat across the room.

See also

#
Drops
Related

References

#
  1. objects/oJar/destroy.gml:17-28
  2. objects/oJar/step.gml:134
  3. objects/oPlayer1/step.gml:1203-1214
  4. scripts/scrUseItem.gml:605-646
  5. objects/oJar/step.gml:23-79
  6. objects/oJar/step.gml:37-53
  7. objects/oJar/step.gml:49
  8. objects/oJar/step.gml:106-172
  9. objects/oJar/collision_oWhip.gml:1-21
  10. objects/oJar/collision_oBullet.gml:1
  11. objects/oExplosion/collision_oItem.gml:1-5
  12. objects/oJar/step.gml:83-103
  13. objects/oJar/destroy.gml:3-28
  14. objects/oJar/destroy.gml:17
  15. objects/oJar/destroy.gml:18
  16. objects/oJar/destroy.gml:19
  17. objects/oJar/destroy.gml:20
  18. objects/oJar/destroy.gml:21
  19. objects/oJar/destroy.gml:22
  20. objects/oJar/destroy.gml:23-28
  21. Clip jar/throw
  22. objects/oJar/step.gml:106-148
  23. Quirk 1 (docs/quirks.md)
  24. objects/oJar/step.gml:114-130
  25. objects/oJar/step.gml:131-139
  26. objects/oJar/step.gml:139-147
  27. objects/oUFO/step.gml:6-16
  28. scripts/scrTreasureGen.gml:44-45
  29. scripts/scrCreateTileObj.gml:118-121
  30. scripts/scrRoomGen2.gml:490-494
  31. objects/oJar/collision_oWhip.gml:9-21
  32. Clip jar/whip
  33. objects/oJar/step.gml:1-25
  34. objects/oLevel/step.gml:65-77
  35. objects/oPlayer1/step.gml:842-850
  36. objects/oJar/step.gml:90-103
  37. objects/oJar/step.gml:143-144

Source code

  • objects/oJar/create.gml
  • objects/oJar/step.gml
  • objects/oJar/destroy.gml
  • objects/oJar/collision_oWhip.gml
  • objects/oJar/collision_oBullet.gml
  • objects/oPlayer1/step.gml
  • scripts/scrUseItem.gml
  • scripts/scrTreasureGen.gml
#