Instructions
Load "Minecraft" and enter a game world.
Level the area around your construction project to make a flat surface.
Dig a trench around your structure two or three blocks deep. You can fill it with water or lava if you wish, or simply leave it empty. Leave a space for you to get back inside the door.
Go inside your structure when it gets dark and any monsters chasing you will get fall in to the trap and die once the sun comes out.