Minecraft wiki entry for Things_not_to_do, associated text: While fighting a creeper using melee attacks, the player can use a sprint attack by hitting the creeper while sprinting. This attack hits the creeper farther away than hitting it normally. Usually, this distance is enough to keep the creeper far enough that it doesn't explode, but if it hits a block while being knocked back by the player's attacks, the creeper may not be knocked back far enough. This or missing an attack on a creeper could leave the creeper close enough to explode. Using weapons with Knockback or Punch may help keep a creeper away from the player. Shields are effective against creepers.