Fence

Fences are wooden wall blocks. They count as one and a half blocks tall for player/mob collision, and one block tall for all other purposes. This prevents players and mobs from jumping over them, while using only one actual block space.

A fence occupies the center space of blocks and automatically connects to any solid block that is placed next to it. Fences are broken most quickly with an axe.

Fences also have a wide use of enclosing animals, such as pigs, chickens, cows, and sheep. They can be used to hitch mobs with a lead.

Crafting
As of 1.8 (14w32a)
 * Three blocks of wood will make eight fences with no leftover sticks. Similarly, 24 logs will make a stack of fences.

The type of planks you use will determine the type of fence you get. (Discovered by DerplingDiamondMaster98)

Natural Occurrence

 * Fences form the uprights for the supports in Abandoned Mine Shafts, where they are plentiful.
 * They are also found in NPC Villages, where they appear in tables, lampposts, and even enclosures on roofs or behind buildings.
 * Fences occur in library rooms of Strongholds as railings and chandeliers. In the latter case, there are many Torches attached to them.
 * Fences appear on the "patios" and in the front window of Witch Huts

Usage
A fence's primary use is for enclosing an area. Functionally, the fence serves to keep mobs and players either inside or outside. A wide area can be made monster-resistant by enclosing it in fences and lighting the inside portion heavily. This stops any monsters from spawning within the fence, and stops most monsters which spawned outside the fence from coming in; the exception is spiders, which can climb over it. In addition, while skeletons are unable to cross a fence, they can shoot over it; also, if there is not a roof, or the roof is three blocks high or higher, Endermen can still teleport in.

Fences can also be used as railings, especially on the edges of balconies, bridges, or floating platforms. Since fences cannot be jumped over, this keeps players and mobs from falling off while still allowing them to easily see past the fence. If there is water at some distance, they can easily be fished over, by aiming above the horizon level. If a fence is placed in water it is possible to cross it.

Fences can replace glass for windows, as mobs cannot see through them. Unlike glass, fences can be moved around trivially, and are easily renewable.

Fences are excellent for building underwater bases. They provide outside visibility, and create a breathing space on the outside, which simplifies construction immensely. Fence ceilings also do not "drip" water. Leaving an outside wall corner open creates a waterproof door you can use, as long as both the wall ends in question are made of fence.

Single fences can also be used as freestanding diving bells; place a soft block such as sand, put the fencepost on top, dig out the block and you have an air bubble at head height. Optionally, embed a Jack 'o' Lantern in the ground underneath for visibility.

Fences can be used for an effective water elevator, with a 2x2 shaft have the water in front and the fence posts stacked behind. This also acts as a source of air underwater, as fences are not a full solid block.

By surrounding a platform with floor-level fences and putting a two-block-high ceiling above, you can make a platform that is impossible to walk off of yet provides an unobstructed view (or field of fire). Ideally, this platform should be made for top-half slabs, since that way the fences will not attach to the platform. If a fence is placed in water it is possible to cross.

If short of buckets, a single fence can be used to cap a leaking water or lava source. This leaves the capped fluid still visible, preventing a forgetful player (or, in SMP, another player) from later mistaking the cap for a stray block and mining it. It also allows capped lava to still provide illumination. However, since lava burns fences, lava springs can only be capped temporarily unless you use cobblestone wall or nether brick fence instead.

Fences can be made into a bridge by making a 3-5 wide set of Fences in front of a ledge or shore, with more fences for railings, and pressure plates in the center to walk on.

Because fences are 1.5 blocks high, they can be used with other blocks to create shallow stairs (the kind you can sprint up). They have the advantage of allowing a view through the stairs, in case of a monster lurking underneath.

Fences (of all types) can be used to create water drains in floors. Dig a 2-block-deep hole in the floor and put a fence in the bottom. Since the hole counts as only half a block deep for entity collision purposes (due to the fence), it can be walked over, but since it counts as empty for block-placing purposes, any water spilled nearby will run into the hole rather than spreading.

Fences can be used to create a cavevision machine, due to the glitch where you can place any block on a fence, even if you're in the way.

Fences can also be used to fuel a furnace, although the player would have been better off burning the wooden planks used to create them.

Fencing tips

 * To craft one stack of fences you need 24 wood blocks. This produces three stacks of sticks, which can be made into one stack of fences.
 * Watch out for blocks standing near the fence, from which monsters, or captive animals, could jump onto the fence and then over. If you're not sure about a spot, try the jump yourself.
 * It matters which side of the fence you're "defending"! For animal pens, you're more worried about escapes -- a monster getting into the pen may be inconvenient, but they're also trapped there.  For perimeter fences, you're more worried about preventing entry from outside. Some fences serve both purposes at once.
 * Any block next to, or one space away from, the fence, is an obvious hazard. Remove the blocks, replace them with slabs, stairs,  etc, or make the fence higher.
 * For similar reasons, any time your fence goes downhill by one block, make the downhill side two-high for at least two blocks.
 * A less obvious problem: If you build a two-high fence next to 1-high blocks, a mob (or you) can step from those blocks, up a half-block to the lower row of fence (where it joins the blocks), then jump up one block up to the top of the fence.
 * If you are roofing over only part of an fenced enclosure, or your railway is going through a shallow tunnel, you will need to fence off the overhanging roof, to keep monsters from jumping down. (Also, you may need to light or fence off the roof itself.)
 * Trying to build a wooden fence around a lava pit is not a good idea, as the fence will catch fire if placed on the block directly adjacent to the lava. Fences can be set afire by lava even if the pool's surface is several blocks below ground level.
 * Wooden fences will not attach themselves to most transparent blocks, with the exception of other wooden fences and fence gates. Thus they will not attach to other sorts of fence (nether brick fences, iron bars, cobblestone walls, glass panes), nor to stairs, single slabs, or doors.  Likewise, they will not attach to glass, ice, pumpkins/jack-o-lanterns, chests or anvils.  However, the gaps produced can be useful:  e.g., the gap between a fence and a door is too narrow for even cave spiders to pass, but the player can attack through it.
 * To make sure that a complex fence system is secure, wait for nightfall inside the fence, look for a zombie outside the fence, and try leading it around your perimeter. If it starts heading for a spot other than just the point closest to you, it means that a path to you does exist and he's spotted it.  (Watch out for other mobs trying to join the fun, and keep your bow handy.)
 * Mobs cannot pathfind through the gap between two diagonal fences. However, other mobs can push them through such a gap, so your animal pens still need corner pieces.
 * Regularly walk your borders and check your pens, in case an Enderman has sabotaged your fence by dropping a block nearby.
 * Think about your entries and exits:
 * A one-way path -- a gate or door with a pressure plate, an archway with a chests or soul sand on one side, or even a "stray" block in the right place -- can be useful. They can let an escaped animal wander back into its pen, or a monster wander back out of your territory.
 * A gate with pressure plate also lets you quickly get in or out of a pen with minimal chances of escapees. If you still manage to leave the gate open, the first mob through will shut the gate after them as soon as they get past the plate.  (A mass of animals can still be a problem.)  Gates and doors can also be controlled with redstone, to control mob traffic from a distance.
 * If a carpet is placed on top of a fence, a player can jump onto the carpet, while mobs cannot (and won't even try). This is safer than a gate that might be left open, but it also can't be opened to mobs short of breaking it.
 * Don't try to use an item with a right-click function while looking at a fence. The item will not perform said function but will instead appear to be attempting to mine the fence, i.e. the item will perform its mining animation but the fence will never break.

History


When first implemented, the game prevented blocks from being placed above the fence but allowed the fence to be placed on a location when there is a block above it. This loophole was soon commonly exploited to allow fences to be stacked, mainly for aesthetic purposes.

The stacking process was done by creating a wall of blocks one layer shorter than the intended height of the fence and working down. Removing blocks from underneath the fence did not cause it to collapse like cacti and doors, so the lower layers of the wall could be replaced by fences easily, one-by-one. These rules were not applied underwater so they could be stacked just like any other block when submerged.

Before the official release of Minecraft, fence corners did not need to be complete in order to be sealed. A corner where two directions meet at a right angle could be created without the actual corner piece. This would create two separate fences which terminate next to each other without actually touching. While there is a visible gap, players and mobs will still be unable to pass through. This feature could be used to create lengths of diagonal fences, which will appear as nothing but posts, yet will still prevent anything from passing. However, in 1.0.0, the fence's collision box was fit around the fence itself (except for the 1.5 height), thus requiring the corner fence.