events.listen('recipes', function (e) {

function woodFence(name){
e.shaped(item.of('amb:'+name+'_fence', 3), ['   ','ABA','ABA'], {A: 'minecraft:'+name+'',B: 'minecraft:stick'})
e.remove({id: 'amb:'+name+'_fence'})
e.shaped(item.of('amb:'+name+'_fence_gate', 1), ['   ','ABA','ABA'], {A: 'minecraft:stick',B: 'minecraft:'+name+''})
e.remove({id: 'amb:'+name+'_fence_gate'})
}
    var name = ["dark_oak_wood", "acacia_wood", "jungle_wood", "birch_wood", "spruce_wood", "oak_wood", "warped_hyphae", "crimson_hyphae"]
    name.forEach(C => { woodFence(C)})
})