Chances of encountering a charged creeper?

I've seen images of charged creepers but I would like to know what the chances are of just stumbling upon one. Or how often you would find one if you were looking for one.

-
Chances vary, I believe. As the old adage goes, Location, Location, Location. – O-O Apr 25 '12 at 4:17

This is not easily answerable and depends on a number of factors.

First, I'm going to assume that you're playing unmodded, vanilla, single-player Minecraft. It doesn't matter if you're playing in creative or survival mode. I'm also going to assume a 90 degree FOV and normal render distance, just to make the numbers easier. If you increase or decrease either, the chances of seeing a charged Creeper will increase or decrease as well.

Then, there are the requirements:

• You must be playing on Easy or higher.
• Creepers must have spawned (i.e., at least one night cycle must have started where Creepers spawned)
• The Creepers must be on the surface (lightning can't strike underground)
• At least one rain cycle must have started after Creepers have spawned.

If any of these conditions aren't met, the chance of encountering a charged Creeper is zero.

So assuming the conditions are met, let's look at the probabilities.

One Creeper, one chunk

Creepers, like all mobs, immediately despawn if they leave a 128-block radius area centered around the player. So if there's a Creeper around, it's somewhere in that area.

Now, if you deobfuscate Minecraft 1.2.5 using MCP 6.2, World::tickBlocksAndAmbiance() indicates Lightning has a 1:100,000 chance of hitting one block in any specific chunk. And if lightning does hit a specific chunk, the game randomly selects one block within that chunk to get the lightning entity.

A chunk contains 162 (or 256) blocks so given any specific block, there's a 1:25,600,000 chance of a lightning strike. Since Creepers only take up one block and—once spawned—have no block restrictions, there's a 1:25,600,000 chance of a Creeper getting charged.

Since lightning is calculated independently per chunk, we need to account for all loaded chunks. At a normal render distance, a radius of 16 chunks are loaded, for a total of 206. Given the probability of a chunk getting hit by lightning is 1:100,000, that means the probability of at least one chunk getting hit by lightning is 1:485. Multiply that by the chance the Creeper is in that chunk (1:206) and the block the Creeper is on is hit (1:256), the probability of the Creeper being hit by lightning is 1:25,626,249.

One Creeper, all chunks, over time

This is only after one lightning strike, and lightning strikes are calculated once per tick. A tick is 1/20 a second, and according to World::updateWeather(), lightning storms can last for 3,600–15,600 ticks or 3–13 minutes.

So, over time, the probability of that Creeper getting struck by lightning is 1:7,118 at 3 minutes and 1:1,643 at 13 minutes.

Encountering the charged Creeper

But you want to know what the chances are of encountering a charged Creeper are, not the chances of whether one will exist. Since encounter can mean a lot of things, I'm going to use the most liberal definition, which is seeing a charged Creeper. At a normal render distance, you can see 128 blocks out, which corresponds nicely to the allowable radius of the Creeper. And at a 90 degree FOV, you should be able to see 1/4 of the possible render area. If a Creeper is on the surface, you have a 1/4 chance of actually looking in the right direction to see said Creeper.

It's way too complex to try and figure out what happens if the Creeper moves and you move or you're not looking in the right direction, so I'm going to ignore that and assume you and the Creeper aren't moving, but you're actively looking for it by rotating your field of view 360 degrees. Thus, the probability of encountering a charged Creeper should be the same as the Creeper existing.

More Creepers, more fun

Now, if there are more Creepers on the field, you have a better chance of finding a charged Creeper. There are way too many different combinations and scenarios to list out, but here are two idealized scenarios:

1. There's a Creeper in every block. After one tick, the chances of finding a charged Creeper is 1:485. After 3,600 ticks, there's a ~99.93% chance of encountering a charged Creeper. After 15,600 ticks, the probability is effectively 100%.

2. There's exactly one Creeper in every chunk. After one tick, the chances of finding a charged Creeper is 1:124,399. After 3,600 ticks, it's 1:35. After 15,600 ticks, it's 1:8.5.

-
+1 for MATHEMATICS! – fredley Apr 25 '12 at 11:32
Just a note: the difference between the figure for 1 creeper, 1 chunk, and 1 creeper, all loaded chunks is just a little bit of calculation error. That's because a creeper is only ever in one chunk, and the chance of that chunk being hit by lightning is 1:100,000 independently of other chunks. So the number of chunks loaded does not effect the probability of a single creeper being hit by lightning. – Theodore Murdock Jul 13 '13 at 12:32

Edit: See Mark Trapp's answer for the chance of seeing one with the proper conditions met

I would imagine a slim to none chance if you don't improve your chances of seeing one by the means of: going out into an open area outside at night where creepers can spawn while there is a thunderstorm.

As shown in this post, mobs despawn when you unload or leave a certain chunk of land. That being said, if you don't stay in an area for a long time and the creepers don't despawn.... You would have a slight chance BUT creepers only get charged by being struck by lightning. (therefore you would need a storm as well)

If you are really interested in seeing a creeper BECOMING CHARGED, try using theBukkit mod to spawn mobs. So, go into a [creative] world and use the console command:

    /spawnmob creeper 1


That should spawn one creeper per the syntax shown here.

For weather type:

    /weather storm <time>
/lighting <true/false>
/thunder <true/false>


Or you can just spawn a charged creeper with this command with the Bukkit mod:

    /spawnmob creeper electric


Keep in mind you need Operator privileges to use the Bukkit mod

Also keep in mind charged creepers do a lot more damage then normal creepers. If you are not in creative mode, keep your distance if you want to survive!

-