Minecraft wiki entry for Egg_farming, associated text: In general, you'll want to first build a pen to hold them. Single-height wooden fences (or a small cave) will suffice, but either way it's best to add an "entry lock": a fenced space with gates leading both to the pen and to outside. This will help prevent escapees - if one of the gates is always closed, the chickens' pathfinding will never see an escape route to the outside.