its not like the mob in the game isnt coded to go to holes, duh, and also most players are busy with doing anything else other than killing mobs which is why they make redstone traps so that to prevent mobs killing them while they're doin something else