Minecraft Animal Pens. Against the outer, a section of stairs. I'll build a 3×22 and 3×23 pen in my world and see if an animal in the 3×23 pen despawns.
Now mobs can freely follow you into the pen but cannot leave as the stile is 1 1 ⁄ 2 blocks high, the same as fencing, and mobs rarely climb ladders. The problem was allegedly fixed back around 1.4 or 15 or so, but since then, there has apparently been no more effort on the part of mojang to remove this feature. Kill some of them, and get resources.