You will need to ensure your safety. To protect all your hard work, you will need to build fences and walls around your Minecraft structure and farm. This also helps to keep your animals in.
The primary use of a fence is to keep animals in and to keep mobs out. Fences technically take up only 1 block space but function as 1 1/2 spaces tall, preventing players and mobs (but not spiders) from jumping over them. Proper lighting inside a fenced area also limits mob attacks. Meanwhile, fences keep animals contained so that players can farm them effectively.
Fences are also used as guardrails along bridges and even balconies, and you can fish over them. Another immense advantage is that players can see through fences like glass, though mobs cannot see in.
Fences are particularly useful in underwater construction. They’re not a full solid block, so they can be used to create air pockets without the water dripping in, which is useful in creating a water elevator, fence walls, or a waterproof door.
Often used to create bridges (when combined with pressure plates) or shallow stairs (for sprinting), fences also allow passive mobs to be tethered to the fence by using a lead. The main disadvantage is when a block is placed close to the fence — a mob can then use that block to jump the fence. Endermen are particularly notorious for this trick.
To craft a fence, simply place 2 sticks in a vertical column in the middle with 4 wooden planks on either side. This recipe yields 3 fence pieces.
A fence gate functions as a door and always opens away from you. It must be placed on a block, but remains if the block is later mined away. A major advantage is that the fence gate prevents the flow of water and lava even when open (though the gate may catch fire).
Unlike with a door, zombies cannot break through a fence gate, and villagers cannot open one. Fence gates can also be manipulated through redstone such as pressure plates.
To craft a fence gate, place a stick, and then a wood plank, and then another stick on two horizontal rows.
Cobblestone walls function like fences and are considered a decorative alternative to their wooden counterparts. Like fences, they keep out most mobs, but beware: Neither fences nor cobblestone walls can block skeleton arrows, and spiders can still crawl over cobblestone walls.
A cobblestone wall does have a higher blast tolerance than a fence when a creeper explodes, but a cobblestone wall isn’t blast-proof. Cobblestone walls come in two forms: basic and mossy.
To craft, place 6 cobblestones (or moss stones) in two horizontal rows.
Each recipe yields 6 wall pieces. The recipe for moss stone, along with several other decorative blocks. A moss stone wall is just a decorative type of wall.
Nether brick fences are similar to wooden fences, but they’re blast-resistant and fireproof, making them particularly effective against the ghast, one of the most dangerous creatures in the Nether. Nether brick fences also shield light sources, which can be used to affect spawning mobs and growing plants.
A nether brick fence connects to fence gates, allowing you to build a maze by using a mixture of nether brick and wooden fence gate pieces. The nether brick fence confuses most mobs, with the exception of zombies because they can’t see it.
The nether brick fence will likely slow down zombies rather than stop them altogether. Though nether brick fences connect to gates and most blocks, they do not connect to wooden fences.
To craft nether brick fence pieces, place 6 nether bricks into two horizontal rows, yielding 6 fence pieces.
The wooden fence recipe yields 3 pieces, and the stone and nether brick fence yield 6.