This script was last updated for Java Edition 1.16.3 and Bedrock Edition 1.16.40.
Anyone who's ever played or even just heard of Minecraft is likely to know what a creeper is. You know, those frowning green monsters that come out of nowhere and explode in your face, causing you to die and lose everything? Indeed, the creeper is one of the most common and iconic hostile mobs in the game. Since their introduction in the Classic development stage, based on a failed pig model, creepers have become a widely-recognized internet icon and have appeared in various TV series, video games, and in the form of merchandise.
Like most Overworld hostile mobs, creepers can spawn on any solid block at light levels of 7 or lower. They will chase any player within a 16 block radius and will explode if they remain within three blocks of a player for 1.5 seconds. You can also force a creeper to explode with flint and steel, but the 1.5 second delay will still exist. You must use the flint and steel directly, as having it used by a dispenser will not have any effect. The creeper's explosion can deal up to 24.5 full hearts of damage to a mob or player with no armor in normal difficulty, but varies depending on how close the entity is to the creeper.
If a creeper is afflicted with any status effect, for example if it was poisoned by a nearby witch, its explosion will leave behind a temporary cloud which will poison, or cause whatever else effect, to you or any mob that ends up inside of it. Creepers on fire, however, will not set nearby mobs on fire after exploding.
If lightning strikes within 4 blocks of a creeper, it will turn into a charged creeper. These monsters behave the same as normal creepers, but deal twice the amount of damage to both terrain and mobs in their explosion. If a zombie, skeleton, wither skeleton, or creeper dies to a charged creeper's explosion, it will drop its head or skull. Only 1 head or skull will drop per explosion, even if several of those mobs die from the explosion.
When killed, creepers drop 0 to 2 gunpowder. They will also always drop a random music disc if killed by a skeleton or stray with the exception of the pigstep music disc, and always a creeper head if killed by a charged creeper, if no other mobs killed by the explosion drop a head or skull. If you kill a creeper or hit it up to 5 seconds before its death, it will also drop 3 experience points.
Most mobs which are capable of attacking other mobs, such as iron golems and zoglins, will avoid attacking creepers. Even your furry little wolf friends, which will charge at most other monsters if you engage them in combat, won't assist you when fighting a creeper. In fact, the only way for a creeper to be damaged directly by another mob is by an incidental ranged or potion attack or a pufferfish's spines.
However, creepers will avoid any ocelots or cats within 6 blocks, making a tamed cat a useful pet to have with you when exploring. Parrots also can come in handy as a warning as they make hissing sounds when in the proximity of a creeper. Fittingly for its name, the creeper doesn't make any random sounds when idle, so the only auditory cues to its presence are slow footsteps, any parrots you have with you making high pitched hissing sounds...... or the creeper's hisssss.