Open the crafting table
Place 4 wooden planks in the left and right columns of the middle and bottom rows
Place 2 sticks in the center column of the middle and bottom rows
Take the fence from the result box
Use 6 matching wooden planks and 2 sticks to craft 3 fences in Java Edition
Use 4 matching wooden planks and 2 sticks to craft 3 fences in Bedrock Edition
