How to create a door which opens automatically for players but not for mobs?

Solution 1:

The simplest way I know of to make a player only door is to abuse stairs and fences. Since a fence (F) is ~0.5 blocks wide, and stairs (S) are missing 1/4 of a block you can stand between the fence and the stair. And so using four stairs and three fences you can make a player only door. Finally it needs to be surrounded in blocks (B), so that mobs can't get around the setup. such as walking through the middle.

If looking face-on you should have:

BBBBB
BSFSB
B F B
BSFSB

The top left stair has to have a gap in the bottom right corner, the top right in the bottom left corner etc.

Which visually looks like:

Image of mob-only door