Fence

Fences are wooden wall blocks added in the Seecret Friday update 8, version 1.0.17 Alpha. 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.

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 actual enclosures on roofs or behind buildings.
 * Fences occur in library rooms of Strongholds as railings or they form something similar to chandeliers. In the latter case, there are many Torches attached to them.

Uses
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, Endermen can still teleport in.

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.

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 can also be used to fuel a furnace, although the player would have been better off burning the 3 wooden planks used to create each fence.

Also, keep in mind that wooden fences cannot attach themselves to nether brick fences, iron bars, etc. Aside from fence gates and other wooden fences, they will not attach to transparent blocks, such as stairs, single slabs, or pumpkins.

Fences can be made into a bridge by making a 3-5 wide set of Fences off of elevated land. Then, place railings on the side of the bridge by placing fences along the sides. Afterward, place pressure plates in the center 1-3 rows.

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.

Because fences are 1.5 blocks high, they can be used to create shallow stairs (the kind you can sprint up). They have the advantage that they are transparent, so when descending you won't be surprised by monsters hiding under the stairs.

Fencing tips

 * To craft one stack of fences you need 24 logs. This produces three stacks of sticks, which can be made into one stack of fences.
 * The following does not account for gates, or extra fences needed for blocking jump routes:
 * To enclose an area of L&times;W in size (L being length and W being width), you will need enough fences for the entire perimeter P, which will be double the sum of length and width, give or take 4 for the corners. If L and W do not include the fences, this will be P = 2L + 2W + 4.  If they do, then P = 2L + 2W - 4.  A classic 9&times;9 farmland plot will take 40 fences to surround.
 * To fence a length of minecart track, you will need double the number of fences as you placed rails. (If you used 2 stacks of rails, you will need 4 stacks of fences.)  This doesn't depend on how far from the rails your fences are, nor are diagonal runs any different.
 * Watch out for nearby blocks outside the fence, from which monsters could jump onto the fence and then over. If you're not sure about a spot, try the jump yourself.
 * 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 monster (or you) can step up a half-block onto the lower row of fence (where it joins the blocks), then jump from there 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.

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.

Bugs

 * Fences attempt to attach to all sides of a block if possible at all. As such, they will try to attach to the front and back of Fence Gates.


 * When two lines of fence meet to make a corner, the resulting corner acts as a block, and you cannot move onto its area.


 * The 1.9 Pre-release also introduced a new bug. When walking on the block that the fence is occupying, the player will not be 'seen' by mobs. If the player is low on health and being chased by mobs, the player can jump on a fence to avoid taking damage.


 * In SMP, mobs can get on top and even over fences, even if is one layer of fences on top of another layer of fences.


 * If a mob gets on a fence, it will spin around "walking" on the fence until something pushes it off


 * If you place a fence on the side of a block, you will be able to walk on top of it without jumping. Even if there is another fence on top of it, you can still walk on the top of the first fence and therefore jump to the second. Works with nether brick fences too.