Slime

A slime is a hostile mob in the shape of a hopping green cube of various sizes. They are able to see the player through solid blocks, and will always try to move directly toward players without regard for obstacles or hazards. When killed, a slime will split into smaller slimes, except for the smallest slime which will drop slimeballs instead. Slimes are found in either the lowest 40 layers (0 through 39) of certain chunks or in swamp biomes in darkness, depending on the moon phase. On the Xbox360 edition, slimes can also be found below level 40, however not in swamp biomes.

Usage
Slimeballs, which tiny slimes drop, are a key ingredient in sticky pistons. They can also be combined with blaze powder to create magma cream for brewing fire resistance potions. They are also good targets for gathering experience, since they are plentiful in selected areas, and killing a large slime plus all its fragments will give from 12 to 28 experience points.

In snapshot 13w18a and later, slimeballs are used to create a lead.

Behavior
In vanilla Minecraft, only sizes 1, 2, and 4 spawn naturally, and with equal probability. With use of map editors or mods, Slimes can potentially range from size 1 to 256.

Slimes move by hopping, which they will do each 10 to 30 ticks ($1⁄2$ to $1 1⁄2$ seconds). Their exact routine is as follows:

The Slime will search for a player within 16 blocks (spherical) distance.
 * If no players are found, they wait 10 to 30 ticks (&frac12; to 1&frac12; seconds). Then they will change direction, by a random amount up to 57.26° (1 radian) left or right, jump, and repeat the process.
 * If a player is found, the delay before jumping will be $1⁄3$ as long (3 to 10 ticks), and the Slime's direction will be set directly toward the nearest player before jumping.

An interesting observation about slimes is that when you spawn at least five of them in the overworld (in survival or creative modes), they all seem to hop in the same direction rather than wandering around aimlessly like a regular mob. This also applies for Magma Cubes.
 * Interaction with environment
 * Each time a Slime lands (Slime size * 8) Slime particles are spawned.
 * Slimes cannot swim upward in water, and will eventually drown if the water is deep enough.
 * Slimes can trample farmland.
 * Slimes can take damage in all the usual ways: burning, falling, drowning, suffocating inside blocks, being attacked, falling into The Void, etc.
 * Slimes can climb ladders, and be pushed over slabs & stairs.
 * Only medium or large size Slimes will generate sound when they jump. Mini slimes make a Jell-O noise.

Combat
Slimes' health is equal to their size squared. A slime's dimensions are 0.6 blocks times its size in each dimension.

When the slime has found a player it will come after him/her and will try to collide with the player. When a slime collides with a player it will deal damage equal to its size, except for size 1 (smallest) slimes, which cannot harm players directly (though they can push players into lava or other hazards).
 * When the Slime is attacking the player

When the player manages to kill the slime and the slime's size is bigger than 1 it will die and spawn 2-4 new slimes equivalent to its size/2, rounding down. If its size is 1 it will drop 0 - 2 slimeballs, but if it's larger it will only drop experience. All slimes drop experience equal to their size.
 * When the player is attacking the Slime

Spawning
Slimes naturally spawn in certain areas deep underground, and also spawn on the surface of swamp biomes during the night as of 1.4, which makes Slimes more common and therefore makes it easier to obtain Slimeballs. Slimes will also spawn if the world type is superflat. As of update 1.5, spawn rates are affected by the phase of the moon. As of update 1.6, slimes may rarely spawn on other biomes, with their spawn rate also being affected by the phase of the moon. Also, slimes will often remain in the world during the day, though no new slimes will spawn until night falls. Often the slimes will drown. When in superflat worlds Slimes can spawn on the first layer of the map on both Xbox and PC.

Swamps
In swamps, slimes may spawn at night between the heights of 50 and 70. They spawn most often on a full moon, and never on a new moon. This can make gathering slimeballs difficult, as it takes over two hours for the moon to cycle.

Low Layers
Slimes spawn throughout the world below layer 40 (0 through 39), but only in certain chunks, 1 in 10 of all chunks. These that are determined pseudo-randomly by combining their chunk coordinates with the seed of the world. Tools exist to calculate which chunks are slime chunks—see Slime Finding Tools.

One in 10 of chunks will be able to spawn slimes underground, based on the formula: Random rnd = new Random(seed +                         (long) (xPosition * xPosition * 0x4c1906) +                          (long) (xPosition * 0x5ac0db) +                          (long) (zPosition * zPosition) * 0x4307a7L +                          (long) (zPosition * 0x5f24f) ^ 0x3ad8025f); return rnd.nextInt(10) == 0;

That is, using the chunk coordinates to help generate a seed, a random number between 0 and 9 will be generated, and if that number is 0, the chunk will be able to spawn slimes. To convert world coordinates to chunk coordinates, divide by 16 and round down. (Note: If the chunk is in a Mushroom Biome, it can only spawn Mooshrooms.

Due to the fact that flatland worlds can be generated with a surface level well below the necessary height level for slimes to spawn (notably the default flatlands, whose surface is 3 blocks above bedrock), slimes tend to spawn abundantly on flatland map types. This is because there are no caves, all spawnable area is lit during the day and slimes are the only hostile mob that can spawn in the light. Slime spawning on a Flatlands world can be prevented by using a preset whose surface level is above layer 39 (for example, the "Redstone Ready" preset).

Like most other mobs, Slimes require two vertical non-opaque blocks (e.g., air, signs, torches) to spawn in, with an opaque block underneath. The space they spawn in must also be clear of solid obstructions and liquids. Big Slimes require a 3x3x3 space to spawn, small Slimes require a 3x3x2 space, and tiny Slimes require a 1x1x2 space (or 1x1x1 if the upper block is not opaque). Slimes are equally likely to spawn at all sizes. Slimes are much more likely to spawn in a 3 high room.

Slimes spawn only 1/10th as often as other hostile mobs, so unless a swamp biome is nearby, they can be hard to find. Slimes can spawn in any light level and lighting does not affect their spawn rate. However, lighting up the surrounding area does decrease the chances of non-slime mobs spawning and thus indirectly increases slime spawning rates. Glowstone has the same properties as glass, so mobs cannot spawn on it. When lighting the floor, Jack-o-lanterns are recommended. Slimes have equal chances to spawn at any size. It is intended for tiny slimes to spawn in peaceful mode, however, the code to allow this is skipped over when the game is on peaceful.

Like other hostile mobs, slimes will not spawn within 24 meters (spherical) of any player, and will despawn instantly if no player is within 128 meters. However, other mobs will also randomly despawn over time if no player is within a 32 meter range. In contrast, slimes will never despawn if there are players within the 128 meter range.

Farming


Once a slime spawning chunk has been determined the process of encouraging slime spawning is relatively simple. The player can clear out large rooms - typically 3 x 3 x 3 or larger. It might be wise to light these rooms to prevent other hostile mobs from spawning. Waiting for slimes to spawn in these rooms can be lengthy at times, however. See the Slime spawning page on minecraftforum.net mentioned above for more information on how to increase this rate. Killing the slimes with either fire or water is recommended.

Pre-1.4 spawning
The (pre-1.4) slime spawning algorithm is discussed in greater detail in this forum topic, but note that the algorithm has changed many times and older information may no longer be accurate.

Due to the relative difficulty of finding slimes before 1.4, a number of tools exist to aid the player in finding a location that can spawn slimes.


 * Slime Finding Tools
 * http://mcslimes.appspot.com/ (Java applet, allows you to upload a level.dat file from a server or multiplayer for seed, very useful)
 * http://extension.ws/minecraft/slimes.html (HTML/JavaScript)
 * Rei's Minimap is able to to highlight chunks with the ability to spawn slimes in a singleplayer game.
 * What's My Light Level can also aid players in finding Slimes.
 * Minecraft X-Ray, since version 3.4.0 (external map-viewer, not a mod)
 * AMIDST Finds Slime chunks as well as Strongholds, Villages, and Biomes. (external program)

Trivia

 * When a player recieves damage from a slime, the "punching" sound effect that plays when taking damage sounds squishier and wetter than normal.
 * Slimes may have been inspired by a number of classic gaming monsters. Their shape and size resemble that of Gelatinous Cubes from Dungeons & Dragons (though admittedly that probably comes more from Minecraft's cubic art design), while their splitting behavior resembles that of Zols and Chuchus from The Legend of Zelda, Puddings from Nethack and Ameboids from Ratchet and Clank. The name and the large, cartoonish face may be a homage to Yuji Horii's iconic Slimes from the Dragon Quest series.
 * Since there's a limit on the number of hostile mobs that can exist in all the loaded chunks at once, splitting several slimes into tiny slimes and letting them follow you will greatly reduce the chances of encountering other monsters.
 * Slimes will only attack the player, even if a skeleton accidentally shoots it.
 * Slimes do not use the updated Mob AI, and still move directly towards its target, even if they will fall off a cliff.
 * There's a line in the code that's meant to allow tiny slimes to spawn on Peaceful, but the natural spawning algorithm skips hostile spawning entirely on Peaceful. As a result, this line won't even be reached. However, there are illegitimate ways to spawn tiny slimes on Peaceful, e.g. with a Slime Monster Spawner.
 * Slimes hop faster when pursuing a player.
 * Despite Slimes being hostile mobs, many players have tiny Slimes as pets since they follow and can't directly damage players. They will also push Minecarts you are in, allowing for Slime-powered minecarts as they follow you.
 * From one large slime, the minimum experience you can get from killing it and all the slimes that split from it is 12, 4 from the largest, 2 from the 2 it splits into, and 1 from the 2 each of those split into. The maximum experience possible is if the big slime splits into 4 and each of those medium slimes split into 4, resulting in 28 total experience.
 * Slimes can climb ladders, and once in pursuit of the player, their straight-line pursuit can take them right to the top, if a player is waiting there.
 * Slimes do not prevent you from sleeping, meaning you do not get this message: "You may not rest now, there are monsters nearby".
 * One-block ceilings of opaque blocks immediately below slimes will have a green "leak" particle effect (as with lava and water).
 * Because slimes spawn in swamps at night, they often jump in the water and kill themselves.
 * If you get inside a slime you'll see the old black eyes.
 * In old alpha, the third-person view wasn't centered, so that was an easy way to find slimes.
 * If you sprint-fly into a slime, you see their old texture.
 * As of the 1.6 pre-release, slimes have naturally been found in other biomes, especially in snow biomes, although this might be a rare occurrence.
 * To calculate the health of a slime, the formula is the following: (size+1)^2, so a slime with size 127 has a total of 16384 health points (8192 hearts); the same applies to magma cube.