In domesticated bee hives, this is usually accomplished by excluding the queen from a section of hive frames (by the size of the entrance hole), so that these frames only contain honey and no eggs/larvae. For instance, this can be achieved using a queen excluder.