Minecraft wiki entry for Carpet, associated text: Carpets can be placed on top of fences and walls to allow the player to jump on top of them while still preventing animals and mobs from crossing. This is because mobs do not try jump over fences and walls, even with a carpet above.