When a creeper settled on the only part of rail in miles that had powered rails, I shrugged it off. When two creepers dropped on me from above without giving me a second of chance, just as I was passing over a lake of fire, I thought "bad luck". But when I ran naked at night, after a respawn, to a shelter with iron door, chased by a crowd of mobs, only to find the one specific block with the door button removed by an enderman, I began suspecting there's more to it than "hide in random dark place", "move blocks at random" etc.
Is there a specific code in Minecraft, responsible for mobs trying to damage critical infrastructure on purpose? e.g. an enderman preferring that one block with a button on it versus 300 other blocks of the house?