Tutorials/Defense

The best defense measures are those that prevent hostile mobs from spawning entirely or at least prevent hostile mobs from ever getting close to the protected area or defense mechanism. As such, integral to all Minecraft defense systems:


 * Completeness - all defenses need to completely defend the protected area or defense, so that mobs entering from any side or angle and of any type will not break through


 * Light - a regular system of lighting with torches, fire, or lava is needed so that, during the night, hostile mobs will be prevented from spawning within the protected area


 * Sustainability - defenses should work regardless of player input and, ideally, would be able protect an area indefinitely, either by never degrading in the first place (e.g. walls) or by renewing themselves automatically


 * Ease of use - The best defense in the world is useless if it kills the owner or friends. A good defense must be safe and easy to use. If you have to press 2 buttons and destroy a block to activate it, it is too complicated.

Passive Defenses
Passive defenses consist of those defenses that, without any input or sensory devices, prevent hostile mobs from entering the protected area. The most common example is walls - they do not have to sense a mob coming or sense its position to prevent it from entering a walled off area. The following sections discuss various types of passive defenses, their construction, maintenance, and applicability.

Passive defenses generally fall into one or more categories, sorted by their impact on an aggressive force.


 * Delayers slow down the progress of an enemy inwards. A ring of torches is a delayer because it increases the distance mobs must spawn from the structure (and player), thus increasing the time it takes for them to reach the next layer of defense. Soul sand and slime blocks are also delayers because it reduces the movement speed of anything moving on it, including mobs.
 * Obstacles are structures that mobs cannot move past without somehow overcoming them. The quintessential obstacle is a wall; a zombie cannot move past a wall without somehow creating a breach or slipping in through an unclosed door.
 * Damagers cause harm to an enemy, in addition to just stopping or slowing them down. They might also do neither, letting the mob through without a reduction in speed, but hitting them for damage as they pass. Currently, damagers either inflict direct hit point damage on a mob, or set them on fire. If additional status effects are added (for example, if the player can create a block which poisons anything that moves over it), these would also fall into this category. A damaging delayer could be a moat of lava; while a damaging obstacle could be a wall of cacti.

It is important to note that each mob type will treat each defense differently; for example, a ring of burning netherrack is a damager to most mobs, but does nothing against zombie pigmen. Likewise, a wall is an obstacle to a creeper, but is a delayer to a spider (and not a very effective one at that).

Walls
Walls are simple vertical barriers and are the most common means of stopping mobs from entering an area. They can be constructed of just about any material, with varying advantages and disadvantages.

These are simple to make, just make sure to:


 * Make them at least 3 blocks high
 * Add an extension around the outside to defend against spiders. (make it out of glass if mobs are all you are worried about to burn those skeletons).
 * Torches should be added to the top or sides of the wall, unless low-visibility is desired (for example, to reduce the chance of other players noticing a camouflaged wall on an SMP server).
 * Ditches or moats can be added on the inside or outside of the wall as an extra barrier.

Materials
Cobblestone and dirt are the most common materials for making walls, due to their abundance as a waste material from mining, and ease of obtaining, respectively. Walls made in desert biomes may also be made of sand or sandstone.

While dirt does not resist explosions well, for most purposes it is suitable. Both dirt and sand walls are frequently used to surround "first night" shelters.

Cobblestone, and the more aesthetically pleasing smooth stone, are the preferred materials for established miners. It has a respectable blast resistance, while being plentiful.

Sandstone is only marginally better than sand, and should be avoided except for aesthetic reasons.

Glass, ice, fences, fence gates, glass panes ,and iron bars are useful as they can be seen through, revealing threats on the other side without exposure. These blocks can also be used to view Endermen without attracting their aggression. The drawback is that these blocks are vulnerable to damage by creeper explosions.

The ultimate in wall construction without cheats or ops privileges is obsidian. When constructing, it is faster to position buckets of lava and cool them with water than it is to cool a pool of lava and mine it.

Although walls are not necessary in creative, an indestructible wall would be made mostly or entirely out of obsidian and/or bedrock.

If the player spawns near a desert, it is quite easy to make a wall of cacti, provided the rules for cactus placement are followed. One cactus block will be required on each sand block, which will then grow to be 3 blocks tall, and damaging to mobs which run into it.

Special Notes: Fences can be used to make walls that act higher than they really are, since a fence block is treated as 1.5 blocks high if something is trying to jump over it.

Spiders (both the normal and the cave varieties) effectively ignore walls, since they can move vertically. However, the addition of protrusions and overhangs on the wall will prevent the spiders from climbing further. A fence as the center block of a wall also prevents spiders while providing no shade for skeletons.

Walls on demand
If you like large cobble walls, then this is for you.

https://www.youtube.com/watch?v=ikzeLK0iBsE

Cheap mob proof doorway
Here is a Cheap mob proof door that doubles as a mob trap.

https://www.youtube.com/watch?v=CvukjMlXxxQ

Careful. This will kills any pets that are sitting too.

Moats and Ditches
These obstacles, like walls, present a vertical barrier to incoming (and outgoing) mobs and players. The difference between a moat and a ditch is that a moat usually has some kind of liquid in the bottom; so far, only water and lava are available.

Dry ditches, like walls, should be at least three blocks tall on the inside edge, with an overhang or protrusions to prevent spiders from climbing them. Ditches should be (at least) three blocks wide at their narrowest point in order to prevent spiders from jumping over them. It is recommended that players leave a means of escaping the ditch to the outside (not the inside, which would defeat the purpose of a ditch), in the eventuality that they are knocked into it by injuries, explosions or simple mistakes.

Moats are constructed identically to ditches and are filled with water or lava, depending on whether harming the mobs or obtaining their drops is required. A water-filled moat, if constructed correctly, can be built into a drowning tank to kill mobs. The down side to this is that a player needs to be nearby to lure mobs into the water, and the new AI for mobs makes it hard to do this. On a other note water-filled moats will still slow mobs down allowing them to be easily picked off with a bow and some arrows, after which the player can swim out and pick them up, or have water currents deliver them to a pick-up point.

Moats can also be made so that water currents push mobs away; while this makes the moat ill-suited for drop collection, any mob which lands in it will be directed away from the wall, since mobs do not resist water currents unless they are trying to attack the player.

A lava-filled moat, on the other hand, will kill any mobs in short order by itself, but also destroy any drops. Lava-moats have the additional benefit of producing light, stopping mobs from spawning nearby without torches. However, it can be laborious to collect large quantities of lava, which requires at minimum buckets and the discovery of a sizable source of lava. Structures over a lava moat (bridges, overhanging walls, etc.) should have fences or a raised edge to stop players from falling or being knocked in. Lava should not be used where there are flammable blocks nearby, especially trees, plank blocks or wool (among others).

Another form of ditch, which is a lot more compact and uses less space is a cobweb ditch. It only has to be one deep and one wide and mobs will get stuck in the cobwebs immobilizing them to be killed when you walk by. The moat can be easily jumped over. This ditch is useful for making a border for your safe area that outside of you do not need to light up. Cobwebs can be found in Abandoned mine shafts and Strongholds.

Fire
Walls and ditches of all types can be enhanced with burning Netherrack. In the case of walls, the base and/or top can be lined with the burning block, so that creatures running into the wall stand in the flames, or creatures that make it over the wall must pass through flames on the way.

A ditch is easily enhanced in the same way, with the row of fire placed either before the ditch, so that burning mobs fall into the ditch and cannot escape (leaving drops to be collected later), or in the base of the ditch itself, where drops may be destroyed by the fire.

Take note that by itself, burning netherrack is not an effective barrier, as mobs with lots of health can simply run through the flames and attack the player before burning to death. Combining cacti with netherrack is rather effective.

Mob Navigation Trick
Instead of a door, a useful trick is to make a 3 block high entrance, then cover the top and the bottom with any sort of slab. The mob's navigation system tells them that they cannot go through the opening. Beware though, as skeletons can still shoot you and creepers can still explode. Planting vines in front of the entrance will cut their vision.

Light
Light, in the form of evenly dispersed source blocks, should not be underestimated. Even without any physical defensive measures, a wide ring of torches will prevent most hostile mobs from spawning, and if the area is large enough, their random wanderings will not take them all the way through to within attack range of the player by the next sunrise. Torches are by far the most commonly used light source for this purpose. Moats of lava, glowstone and jack-o-lanterns can also be used, though the scarcity of glowstone in SSP is a limiting factor, while pumpkins (which,while hard to find initially, can be farmed) are required to make jack-o-lanterns. Lava is sometimes problematic to use because it ignites flammable material within four blocks.

Soul sand
A ring of soul sand can be a highly effective delaying mechanism, useful for keeping mobs within range of an active defense or just away from a structure. A strip three blocks wide is the minimum for an effective delayer.

Soul sand also makes an excellent bottom for a ditch.

Waterfall
Waterfalls are an effective way to protect your doorway as a last line of defense. By using an over hang, a player can run a waterfall down and over the entrance to their home. A one block deep ditch as wide as the waterfall will prevent the water from flowing in unwanted directions. If a creeper, skeleton, or zombie walks into the waterfall, they will be pushed down into the ditch, effectively stopping them. Though the ditch can be made deeper, it is inadvisable since the player may accidentally fall into the ditch themselves. The downward pressure of the waterfall will cause the player to swim upwards much more slowly than usual, so one block deep is recommended. To enter their home, a player must jump into the waterfall and keep moving forward. This will deposit the player safely on the other side of the waterfall.



Combination Defenses
Like historical defensive formations, the most secure perimeters are based around multiple concentric systems, and systems used in synergistic combination. A classic example is a moat surrounding a walled compound - creatures which might reach and breach the wall (eg, Endermen) are delayed or killed before they can reach the wall by the moat (water or lava). Any and all of the aforementioned passive defensive measures can be used to make an area secure; the only limit is the amount of time the player is willing to put into it at the expense of other goals and the amount of space and time available.

Shelter Defenses
Every shelter needs good defenses, and here are some tips to avoid trouble.

Explosive resistant houses
Explosive resistant houses are fairly easy to build, and aren't extremely expensive. Use the Materials section above to assist you in choosing explosive resistant materials.

Tips
You should have many windows, so as to be aware of any Mobs around. Light your houses and surrounding area well! It is suggested to have an automatic door and protect the surrounding area with a minefield, trap(s), or some sort of defense.

Try making multiple panic rooms/bunkers, preferably for different situations(i.e. creeper in front of your house, skeleton stalking you etc.). Another good idea is to make a emergency exit- this is a deep hole with water at the bottom and some supplies, only use this if its an emergency.

Another, kind of hard, idea is make a way to get behind, under, or above a hostile mob around your house. This could include a tunnel, a water slide or roller coaster.

Try putting dispenser filled with arrows in front of your door(s). Creeper in front of your house? No problem! Hit a button! You could also use sticky pistons and two blocks, so they would block the entrance, but if you do that, you would have to stay inside, or make a second exit.

Security
It can come in handy if you have some security systems up. Here are some ideas:

• Alarm, to make an alarm you will need:
 * At least 1 pressure plate
 * Lots of redstone (Depends on how far away you want the alarm)
 * At least 1 note block

Place pressure plate(s) around an area you would like to protect, or your entrance(s) try to keep them separated as much as possible (optional). Then attach the note block(s) to the pressure plate(s) with redstone wire. From now on, whenever a mob or a player walks on a pressure plate(s) the note blocks will generate a sound notifying you. If you mine a lot, put a note block(s) in your mine or along a rail road.

• A self destruct system might be useful, to prevent others in SMP from stealing your belongings. For this to work, the TNT has to be concealed in a wall, and there should be redstone (that is concealed) attached to a button to activate the TNT. It is also recommended that you have a blast-proof room where you store/hide in before you activate the self destruct. The button should also be in this room.

• If you have a lot of iron ingots and pumpkins, then you can make the perfect defense. Iron Golems have 50 hearts and can kill most mobs in 1-2 hits. Make sure to keep them near your house though; as they may wander away. To prevent this, put the iron golems inside of a trench surrounding your house. The trench should be 2 wide and at least 4 deep, otherwise the golems will fling mobs back out of the trench.

You could try dispensers to defend your home entrance but you would need lots of arrows. Another idea is to push the mob or player in a moat to it a pressure plate, activating a dispenser. It works better with multiple dispensers, all with redstone repeater.

Overall
If you have a bow and arrows, a good way to kill mobs (and perhaps players) that get within range is murder holes. Often incorrectly described as "holes in the ground", the actual term is a hole in a ceiling or gateway in which defenders can fire at enemies. To make one, extend an overhang over your walls to 5-6 blocks outward. Be sure to add battlements. After, dig a 1-block hole in the floor every little bit, so no bit of ground is uncovered. Trapdoors are OPTIONAL. Make sure to build it off the ground so Creepers cannot blow up while you are looking through a murder hole. This also adds to the overall safety, as you do not have to lean over the walls and subject yourself to Skeleton arrow fire when you're sniping a zombie.

Creepers
A simple way to protect yourself against Creepers (or any other 1X1X2 mobs) is a 4 door trap. Place four doors with left hinges around a pressure plate. place a block above the pressure plate to prevent the mob from jumping free.

Adding a waterfall layer around your wall will stop any explosions from damaging your wall.

--          |PP| --

Zombies and Zombie Pigmen
Zombies and Zombie Pigmen are only a threat should you be surrounded by other mobs (and other zombie pigmen) or if you are low on health. Their only way of hurting you are getting up close and personal or breaking doors to allow entry of other mobs. So use arrows... simple stuff. Protecting doors can be done in 3 ways. 1. Placing a column of sand above the door to seal it when it is removed. 2. Placing water next to the bottom of the door. When the door breaks the offending zombie will enter but other mobs will be slowed down. 3. Placing water next to the top of the door and doing the same for lava on the other side. 4. Pistons and pressure plates. 5. You may also place your door 1 block above ground so zombies cannot destroy it. (Zombies destroy door by breaking the top.) 1              2            3         D=door T= Tunnel wall S                                     S=sand W= Water S                                     L= Lava TDT            TDT          WDL TDT            WDT          TDT

Skeletons
Since Skeletons attack from a distance, the best defense is a good offense.You may need to try and outrange them with a dispenser trap or simply just bow and arrow to kill from a distance.

Spiders
An easy way to defend against Spiders is a 1*2 tunnel. Spiders cannot pass through it but players (and other 1*2 mobs) can. A clever way to fight them is to dig a one wide two deep ditch. You can simply destroy the underbelly of the spider. Spiders also can climb walls but an outcropping prevents them from getting over since they can't wallclimb on ceilings

Spider Jockeys
Spider Jockeys combine both range, climbing, a melee attack, and an urge to chase the nearest player no matter how far away they are, the best course of action when you are facing one is to kill it off with arrows before the skeleton notices you and starts shooting.

Slimes
Slimes may spawn above ground during the day. A good above ground defense is a 2 block wide moat of water that will drown them. Slimes can be easily defeated using bow and arrow. Due to their melee only attack, they can also be defeated by sword easily. Small slimes will not hurt you, though they will push you around.

To protect against them if they spawn underground, simply wait and see if any spawn. If they don't, you're fine. If not, try to find where in your mine they are spawning.

Try:

-Blocking cave systems

-Noting and cutting off slime chunks

Remember, slimes spawn in light. TNT is also very effective.

Ghasts
Ghast can not see through glass, so if in the nether with some glass, you could make a glass box around yourself. This is helpful because you can see when the danger of a Ghast has gone. Building a glass base around your Portal in the Nether is a good idea, because you will be able to see the nether's epic terrain, and still be protected from Ghasts. Ghasts also can't see through sugarcane or vines, however sugarcane is impossible to plant in the nether normally due to the fact that you can't get water into the nether without using commands like. Keep in mind that Ghast fireballs now have low blast penetration so many materials are ghastproof (cobblestone being the best known). This doesn't apply to netherrack (which is extremely weak) or any of the transparent blocks. It is traditional (due to Mojang suggesting it to players constantly on the xbox version) to build a cobblestone room around the netherportal to protect it. Also since ghast fireballs can put out a unprotected portal always bring a flint and steel with you. Note that a ghast fireball can also relight a unlit portal, but only if the fireball itself lands in the frame (rather than with it's area effect).

Players
Arrow Turrets.

They consist of any number of dispensers attached to a rapid pulsar redstone alternater. Simply add a lever to the side of the Pulsar, and switch it on or off at will. (needless to say, loading the dispensers is a must!)

These will give any player trying to grief, or steal from, one of your structures, a nice shock. This turret is fully automatic, and as long as you have the arrows to support it, it will demolish anything in front of it! Fire charges can also be used if you have the resources. However these are not recommended if your structure is made out of a flammable material! An easier (and lower resource cost) way to make the turrets more damaging is to put a lava curtain in front of them. This will set the arrows passing through on fire so they cause more damage.

Creepers
Creepers have an explosion nearly as powerful as TNT, so they can easily blow through a wall made of stone, and that opens the door for other uninvited mobs to enter your protected area. The only true WALL that will protect against creepers is a wall made of bedrock or obsidian, the former can only be used: on a multiplayer server with item spawning enabled, with a mod, or via creative mode. Also try filling the wall with water to dissuade endermen. A self-repairing wall can also be created when hooked up to a cobble stone generator but this is generally more complicated than it is worth. If you would like to see tutorials on how to make cobblestone generators, search it on youtube or another site.

Zombies and Zombie Pigmen
Zombies and Zombie Pigmen are difficult creatures to face when in a claustrophobic area such as a cave. They can only attack when they are near you which gives you an advantage and a disadvantage, Advantage is that you can take them from a distance and be safe, Disadvantage is when there are multiple of either one and they surround you. This leaves you unable to escape. If building a defensive structure to prioritize against Zombie you should try and stay away from them but in the case that you can't make sure you have an open area inside and out of your defensive structure such a courtyard so that you have alternatives of escape. The best defense from zombie pig men is not to attack them because unless provoked they will leave you alone(note this only works on pig men).

Spider Jockeys
Create a 1 (Or more) block wide hole in your wall and shoot the spider (Or attack with your sword) and when the spider gets killed shoot the skeleton.You can also try an arrow dispenser trap for payback.

Slimes
You may defend against slimes by simply creating a long 1 block wide, 2 block tall corridor as an entrance to a walled of area using: for the sides, dispensers full of arrows on bottom row, and any block that is solid on the top row for the floor, simply cover it in pressure plates. The said slime will travel through the corridor, and every time it lands on a pressure plate, it will be struck by two arrows, and if/when it splits, the process will simply repeat itself. To collect the spoils, simply remove the pressure plates, stroll on through (reloading as you go if needed) and then when you are done, simply replace the pressure plates on the way out. to help prevent mobs entering while you do this, it may be useful to place a door at the entrance/exit in the wall so you may close it when you are in the corridor and open it to begin the executions. This also works for most other mobs that will fit through the corridor.

Ghasts
There is no particularly expensive way to defend agains ghasts. Glass or cobblestone (which Ghasts cannot damage.) will do just fine, but you could use an expensive material like iron blocks, or obsidian. However, while glass panes protect you from being noticed and fired on by Ghasts, they are shattered in the event a stray fireball explodes near the panes. Glass blocks do not shatter even when hit directly. To fully Ghast proof a Nether fort use only glass blocks, iron bars, or nether fences for windows.

Although, Ghasts are easy to kill if you can hit them, or reflect their fireball at them, two well-charged arrows or hits with an iron sword will take it down.

Endermen
Since Endermen can move blocks, but are hurt by water, make a moat instead of a wall. Also, it's better if it flows through a 1x1 block hole in your house so you get the drops.

Players
When in multiplayer, with nothing to help you in combat with other players, it is best to have a /home point. Some servers also make it so that you can toggle PvP on and off inside your house/land, so it would be a good idea to have PvP off in your house. In order to set your home, type /sethome. If you're ever caught outside with a player in diamond armor, wielding a diamond sword, charging at you... you can just type /home and get out of there (Preferably before he hits you, since some servers have a plugin to prevent escapes from the /home command)! Of course, if you are also wearing diamond armor and also have a diamond sword, you could choose to try and hold off said player. Blocking also helps in these situations.

Basic Redstone Defense - Drawbridge

Very effective entrance mechanism for a SMP base. Works better if within faction land so it can't be destroyed.

8:8:8 = 8 blocks high, wide and long

Create a 8:8:8 pit next to your walls, then fill the bottom layer with lava.

Build a 4 wide, 8 long bridge over the pit, with one high blocks at each side.

Remove the floor of the bridge and place trapdoors instead, attached to the side barriers.

Place redstone all the way along the top of the barriers.

Place blocks one level above the redstone so players can not jump onto the sides.

Link the two lines of redstone at a lever.

Pull the lever to open the drawbridge, not letting anything in; or close it so you and your faction can get out.

Spiders can't jump the bridge, players will fall in the lava, and zombies and other mobs can not cross it, unless it is left closed, so it pretty much keeps everything out, as long as it is built on faction land.

Another effective trap against enemy players is the "KILL" land mine. It is a upwards-facing dispenser, filled with Splash Potion of Harming VII, surrounded by pressure plates. This is most effective if there is a ceiling above, so that the player can't run/walk out of range as easily. However, Splash Potion of Harming VII cannot be obtained without item spawning (in SMP) or mods.

One of the most cost-effective ways of base protection, especially against players is camouflaging. Build your base under the ground or high up in the sky. Another related idea is to build a distraction base.

Advanced defence mechanisms - fake base Step 1: build a hidden base, preferably underground sealed off with sticky pistons. This is the real base, store all your valuables here and make all the important rooms (crafting rooms, storages, etc.) inside this base Step 2: Find a flat piece of land around 20-100 blocks away from the your real base's entrance (If no flat area is available, find whatever comes closest and flatten that out) Step 3: Build a base (a castle-like structure or a village-like one) in this area. If possible, make a very defensive-looking base, for defending yourself and to keep those nosy enemies out of your actual base.

Optional features: - A secret tunnel from the fortress/fake base to your real base, sealed off with a piston hatch/door at the entrance to the fortress, only operated from the inside (the side of the real base) - Moats, traps and/or sniping towers around. For towers, make sure they are only accessible from your own base(s) - A fortress-destruct button at the real base (in case it gets overrun by enemies and you have fled into your real base)to get rid yourself of the foes

Lastly, if your real base is found as well, you do not want to be lost completely. that is why you should always have both a regular storage room as well as a secret one. The regular one you put stuff like iron armor/swords, food, bows and arrows, and building blocks. Possibly some diamond stuff to stop the attackers from getting subspicious. Then, also build a secret room, with sticky pistons and only open/closable from the inside of it, where you put your really valuable stuff (diamond armor, enchantment table, potions, anvil, diamonds, diamond swords, enchanted bows, ect.)

NEVER allow any member of your faction (provided that you are playing on a faction server) to see this secret room unless you really trust and/or know them. This is because most of the pvp-servers with griefing allowed are riddled with traitors and disloyal people who will take your valuables the moment you turn your back on them. A useful way to protect you valuable items can be found on Tutorials/Traps

Mob Defenses
Mob defenses can be effective, when using the right mobs. various mobs you can use are, Iron Golem, Snow Golem, Tamed wolf, or a Tamed ocelot. Also the fact that these do not affect the player (with the exception of an annoyed iron golem or wolves turning on you if you manage to attack yourself (like shooting an arrow straight up)) makes these defenses a little more useful.

Iron golems: The best way to use these is keep them in an enclosed space with a door operable by lever. If invading mobs get too close for comfort you can flick the lever and release the golems to clear the area. Or you can simply leave them wandering free in a walled off area.

Snow golems: The most efficient way to use snow golems (aka snowmen) is in a one block wide tunnel. The snowballs from the golems cause no damage (except to blazes) but push mobs back. This can be used to push mobs into lava or something else that damages them e.g cactus. Or it can simply be used to delay hostiles.

Placing snow golems in fenced off "watch towers" may help protect you from hostile mobs as:
 * The mobs will then attack the Snow Golems as opposed to you, and
 * Snow Golems snow balls push away hostile mobs.

Note on snow golem vulnerability: Make sure you protect the golems from the rain or they will die. Also as mentioned on the snow golem page they will take damage in a desert or jungle biome so defenses utilizing them cannot be used in these biomes. check out tutorials/snow golem defense turret.

Ocelot: The easiest way to use ocelots is to build a fence around them or just let it simply wander around a closed off area and once a creeper comes, it will be scared away since creepers are apparently afraid of ocelots.

TNT Defenses
A good dose of TNT, however dangerous and lag intensive, will destroy all mobs. Obsidian or self repairing land is useful in an area of little or no use to minimize damage. If you use more than 1 TNT most drops will also be destroyed.

You can make mines with TNT and Pressure Plates. It can be useful to place the trap above sand or gravel so that A player will be trapped with the charge and a mob won't be able to wander away.

TNT Cannons
TNT Cannons: The best weapon usable. This should be put outside your perimeter. Go to Tutorials/TNT Cannons to find steps to build these.

TNT Self Destructing System
When you are on multi-player server, and you don't want your enemies taking your loot, you can make TNT SDS (Self Destruct System) Under your base. You need these to build SDS:
 * A lot of TNT blocks
 * Redstones
 * Any blocks
 * Lever
 * Repeater

To make a TNT SDS, first dig 3 blocks under your base. Fill it with TNT on 3 blocks under your base. Than on top of TNTs, put your normal blocks. On top of it, fill the 3rd floor with redstone. Now put repeaters on 3rd floor (right bottom of the real base's floor) and make a road to where you want activator be. Put a lever in the activating zone, and connect your SDS and lever with redstone and repeaters. When your base is in danger and lots of enemies in your base, take as many loot of yours as you can and run. When you are near the Activating Zone, you can now pull the lever- and kill all the enemies. So one of SDS looks like this: 0-Redstone X-TNT 8-Normal Block except Obsidian, Bedrocks etc. 8 8 8 8                       0 0 0 0                        8 8 8 8                        X X X X

Advantages:
 * You can take some of your loot
 * Can kill lots of your enemies at once

Disadvantages:
 * You will lose at least 90% of your base
 * Takes time to build
 * Will lose most of your loot

Land Mines
To create a land mine, you'll need:


 * Some TNT
 * Pressure plates
 * Any block except obsidian or bedrock

To make a landmine, you need to dig a two-block deep hole. At the bottom of this hole, there has to be a single block of TNT. Next, place any block (besides obsidian or bedrock) on top of the TNT. Lastly, place a Pressure Plate on top of the block that was placed on the TNT. Once an entity steps on the plate, the TNT will explode, thus causing damage to the entity and the terrain. (Unless the terrain is made of obsidian or bedrock.)

Advantages:


 * Mobs are usually killed in one blast
 * Landmines are relatively easy to make
 * They can be triggered from a safe location with redstone

Disadvantages:


 * Landmines must be recreated after each use
 * The blast may set off other landmines
 * You or your shelter could be destroyed
 * The mob may go past the TNT while chasing you
 * In most cases, TNT is more valuable than the killing of a single hostile mob.

To counter terrain or structures being destroyed, place water on a side of the TNT. This trap will still damage mobs, but the surrounding blocks will not be destroyed. However, the trap won't be as effective. You can also put blocks that have tough blast resistence like obsidian around TNT landmine.

If you want to make sure that the mob is killed in the explosion and that your base won't blow up, dig a deep hole (break the block NEXT to the one that you're standing on. Jump in, then replace the bottom block(s) with Obsidian and pillar back up. Break the blocks again, and put a TNT block two blocks down, followed by a gravity affected block (either sand or gravel). Put a pressure plate on top and you're done!

Defense on the Move
If stuck out on an expedition, always bring a torch.

By quickly digging 3x3x3 cube into the ground, jumping in, and covering the top layer you've created a little burrow. Add a torch and a bed and you've got a very quick home.

A variation uses the giant mushrooms. All you need is dirt, bonemeal and a mushroom and you can grow a pretty good shelter near instantly. Bring some blocks to fill out gaps (You should always carry some anyway) and maybe some ladders. Fill with bed and torches and you have a shelter!

Another option is to simply build a 1x2 wall around (However large needed or wanted) a space and add some torches and a bed and you have an instant, quick shelter. However, if you want visibility and have slabs, there is a variation. Make the wall, but only 1x1, and add slabs on top of the wall. only use if you happen to have slabs and are stuck somewhere too far to brave back the path to your house.

If you happen to be stuck in a dense forest and cannot make a wall shelter or hole easily, this is perfect. either pillar jump or use ladders to get to the top of a tree and make a platform. You can add walls if you don't have a bed, although it IS recommended. Once the platform is made, add torches (or a bed) and either wait or sleep the night away.

Tips & Tricks
1. Armor is highly underrated– even leather armor could save your life. Should you be going hunting for Ender Pearls, looking for Strongholds or Underground mines, or just going for a nighttime stroll– armor will be very handy

2. Keep at least two swords, a sword is your main source of both defense and offense; yet they can break fairly quickly, leaving you without a weapon.

3. In the Nether, it is useful to carry a bow and a stack of arrows to defend yourself from Ghasts.

4. Construct one window in your house without glass with a dispenser facing outwards, stacked with arrows. Place a pressure plate directly in front of said dispenser, so that you can stand at your window at night, draw a monster's attention, and lure it onto the pressure plate, activating the dispenser and effectively killing the offending mob. One will regularly find rotten flesh, bones and arrows underneath. These arrows can be used to replenish your dispenser. Make sure your pressure plate is made of Stone, otherwise the drops of the dead mobs will keep activating the plate, causing the plate to be disabled for 5 minutes after every use.

6. Though many players like to use gold for its color and value, it is inadvisable to use gold in armor. It does not have very good defensive qualities, despite being more durable than leather, and is thus quickly diminished.

7. Placing a door from the outside is reliable for killing mobs at your door, such as zombie rampages. You can attack mobs from the outside without breaking/opening the door the door but if placed from the inside, only you will open the door instead of attacking mobs outside.

Innovative Defenses
These defense tactics are usually only used to impress others in SMP, but may also be used as an overly expensive way to overly secure a shelter.

Trapdoor Drawbridge
This is a bridge that can be toggled to let the player in and to keep hostiles out. You will need a standard ditch or moat, a half stack or so of any opaque block, and enough trapdoors to cross over your ditch twice. The plans will look like this:

T=trapdoor B=opaque block A=air Layer 1 BBBB TTTT TTTT BBBB Layers 2 and 3 BBBB AAAA AAAA BBBB It's optional to add an overhang to defend from spiders.

LAYER 1

LAYER 2

LAYER 3

Jumping Puzzle Entrance
For people who do rather well on jumping puzzles, implement a course that leads to your door. Mobs can't solve jumping puzzles, so your house is safe.

Floating Island
Make a floating island house and parkour on from a nearby mountain. This is highly inconvienient, but almost completely immune to mob invasion. You must also make a separate shelter for a mine...

Fire Mine
Place a dispenser facing upwards in the ground. Place a pressure plate on the outside edge of the dispenser. Put a flint and steel in the dispenser. Now, when something tries to walk past it, they will trigger the pressure plate. This will cause the dispenser to use the Flint and Steel, lighting itself on fire. The fire will go out shortly, but it will cause massive damage to most mobs.

This defense is best used as a ring around an area you want to defend. Anything steps on the line of pressure plates and it goes up in flames.

Troubleshooting
Most problems in your defense will likely stem from a poor light net around your base. Changing the settings to the classic lighting engine can help you find holes in your light pattern.

In the end a good defensive strategy is only as good as the people that run it. Remember a strategy requires discipline. If you plan on running out for a midnight stroll every night, then don't build a defense, it won't make you any safer.