Fence

Fences are wooden wall blocks added in the Seecret Friday update 8. They count as one and a half blocks tall for player/mob collision, and one block tall for all other purposes. They cannot be jumped over from the same level as the fence but can have other blocks placed on top of them. A fence occupies the center space of blocks and automatically connects to one another when another fence is placed next to it. Fences are one of the many blocks that are broken more quickly with a sword, but deals double damage to it.

Standing on top of a fence in multiplayer counts as an illegal move, and has caused players to get stuck. This action has also crashed the server in the past, though this bug was fixed in the Beta 1.3 update.

As of the 1.6 update, fences are now flammable. As of the 1.7 update, fences are now able to be placed on top of each other.

Uses
A fence's primary use is enclosing an area. Functionally, the fence serves to keep outside mobs and players out, and inside mobs and players in. A wide area can be made monster-resistant by enclosing it in fences and lighting the inside portion heavily. This keeps any monsters from spawning within the fence, and keeps most monsters which spawned outside the fence from coming in; the exception is spiders, which can climb up or even jump over the fence. In addition, while skeletons are unable to cross a fence, they can shoot over it.

Fences can also be used as railings, especially on the edges of balconies 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 a grassy area is fenced in and lit, during the night a large amount of passive mobs will spawn within the fence. This can be used to quickly collect a large amount of drops such as wool or raw porkchops. Additional blocks can be placed along the outside perimeter of the fence, allowing mobs to enter the pasture, but making them unable to leave.

Fence corners do not need to be complete in order to be sealed. A corner where two directions meet at a right angle can be created without the actual corner piece. This will 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 can be used to create lengths of diagonal fences, which will appear as nothing but posts, yet will still prevent anything from passing.

If you place a block on top of a fence, the fence reverts to a one block height (i.e., the total height equals 1 (fence) + the new block height).

If you put a half-block next to a fence it is possible to jump over it.

Stacking (No longer needed as of 1.7 update)


Multiple fences can be stacked on top of each other 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 doesn't cause it to collapse like cacti and doors, so the lower layers of the wall can one-by-one be replaced by fences easily.This can also easily be done under water with no need for walls or layers below the fence,you can stack fences underwater just like any other block, beginning with one fence post at the very bottom. This allows the players to make thin pillars or chandeliers to seemingly support floating blocks for decoration purposes or to make "streetlights" - two fences stacked with a glowstone block or torches on all sides of a wooden plank on top of it. That may be useful for SMP towns, althought some modded servers have stackable fences installed.

Crafting
A formula to calculate the needed amount of wood blocks to make enough fences to surround an area would be W = (3 * (N - U) ) / 8 where W is the amount of wood, N is the number of needed fences (the perimeter for all intents and purposes) and U is the number of fences that you can use for the perimeter. Remember, due to the immense amount of materials, you may have extra fences when dealing with larger amounts of fences.

Future Plans
From Beta 1.7, torches can be placed on top of fences.

There may be plans to add a gate, which would most likely be placed like a fence, and fit aesthetically with other fence pieces. However, it would act like a door, where you would click it to open it. Doors work fine as a substitution, but look out of place between fence posts. This topic is most recognized at this thread on Getsatisfaction.com, where Notch himself commented saying "Hmmm... Possibly! Why not?". That thread was later marked "Under Consideration".

The problem holding this back is that fences are centered while the normal doors are on the edge.