No Mob Spawning on Trees Mod 1.12.2/1.10.2/1.7.10 offers a possibility to prevent mob spawning on trees. So, it can stop creepers from falling on the head.

No Mob Spawning on Trees
It works well with some mods that allow you to create big trees, for example, Realist Generation, ExtraBiomesXL, or ThaumCraft, etc.
Possibilities:
Turn off mob’s spawning on wood logs (by default)
Disable that capability on mushroom chunks (default)
Control mentioned-above functions via customized rules.
Add or override entries of the list
Modify the spawning capacity of creatures
Enhance the entire rate
Settings in a config file:
Mob name/type
Biome name/ID/type
Dimension name/ID
Game ticks
Light level
Moon phase
Probability
Spawn block name/material
Spawn location
Catalog:
Ghast in the desert (by adding “@biometype: SANDY, mob: ghast, weight: 1000” to Rules)
Peaceful plains and dangerous savanna (add biome: plains)
Modpack:
It’s easy and free to include the edition in any modpack of you.
List of other mods you can love:
Better Auto Jump
Light Level Overlay Reloaded
Unicode Font Fixer
No Mob Spawning on Trees is a server utility mod giving some notable changes for mobs. Download and install Minecraft Forge to try out!
How to install No Mob Spawning on Trees Mod:
Assure that you have already installed Minecraft Forge
Define the location of the Minecraft application folder.
On the windows, open Run from the Start Menu, write %appdata% and click to Run
Open Mac on the finder, press and hold Alt and click to Library on the peak of the Menu Bar. Open the Application Support directory and look for Minecraft.
Put No Mob Spawning on Trees Mod you have already downloaded (.jar) into Mods directory.
When you start using Minecraft, open the mod button, you will realize that No Mob Spawning on Trees Mod has been set up.