User blog comment:Alixgirl11/Getting NPCs to Stay in their Houses?/@comment-98.87.35.65-20111217024721

You could use active stone blocks.