This is a type of defense that you can use in either singleplayer or multiplayer. This is very effective against any person or mob.
***DO NOTcreate this project if certain flashing patterns can trigger a medical problem***
Step 1: Materials
Step 2: The Basics
First create a 5 by 7 block of any non-flammable block. Make the slab two blocks thick. Then on the side with 5 blocks make a one block hole in the middle of them. If you do it correctly you should have the stone blocks above it but you should also have two more blocks on each of the sides of the holes.
Step 3: The Mechanics
Create the Minecraft Machine Gun on top of the block (To make the Machine Gun look at my other instructable called Minecraft Machine Gun). Make sure to center the machine so that it will work properly.
***DO NOT put the lava there it is an old picture***
***Keep the one block hole and DO NOT fill it up yet that will come in a later step***
Step 4: The Ammo
Next connect two hoppers on the side of the dispenser (If at least two hoppers are not used the fire rate of the dispenser will not be very effective). Put a chest full of arrows on top of the hoppers. You will notice that when the machine is not on, the dispenser will not fill up, this is completely normal.
***Arrows are not the only thing you can put in there you can also put fire charges, snowballs or hostile mobs. I do not recommend the creeper because of the possible damage that it may cause to you or the machine***
Step 5: Repeat
Repeat steps 2-5 as many times as you would like to the length you would like. (Remember that the first slab of blocks was 5 blocks in width so if repeated you should still make a 5 block width slab. This will be 10 blocks in total width as shown in the picture).
Step 6: The Wall
Next add the wall in front of the machines. You must make the wall one block in front of the slabs so that it will not cover the hole that you made earlier. Make the hole as wide as the slabs are (or past the slabs if preferred) and make the wall one block higher than the top of the chests. Then make holes where the dispenser would shoot out of.
Step 7: Lava Holdings and Lava
Put the first block in front of the hopper as shown in the picture, then place two more blocks above that block so it will be three blocks tall. Repeat this in front of each hopper. After that put two block on top of the dispenser (you can destroy the block touching the dispenser after they are placed because you really only need the top block). Make sure not to cover the hole that was made earlier. After you've paced all the blocks required place the lava in the top hole (Do not worry about the lava spreading because the hole will catch it).
Step 8: Archer Spots (optional)
You can make a hole between the chests in the wall for manual archers. Place two blocks between the slabs and the wall so that you will not fall between the two. This can be useful if there are places where you would like to cover where the machine does not cover.
Step 9: Decoration (optional)
You can add one block pillars to the top of the wall to give it more style or to make it look more like a castle. Of course you don't have to do this but it makes it look nice.