function fWheat(l: location, d: number, pz: number, c: number, p: player): loop all blocks in radius ({_pz::%{_p}%} + 4) of {_l::%{_p}%}: if loop-block is fully grown wheat plant: play sound "ITEM_CROP_PLANT" at volume 0.7 at pitch 0.3 at location of loop-block if {_c::%{_p}%} > 0: set loop-block to wheat plant add 1 to {_d::%{_p}%} add -1 to {_c::%{_p}%} else: set loop-block to air add 1 to {_d::%{_p}%} function fCarrot(l: location, d: number, pz: number, c: number, p: player): loop all blocks in radius ({_pz::%{_p}%} + 4) of {_l::%{_p}%}: if loop-block is fully grown carrot plant: play sound "ITEM_CROP_PLANT" at volume 0.7 at pitch 0.3 at location of loop-block if {_c::%{_p}%} > 0: set loop-block to carrot plant add 1 to {_d::%{_p}%} add -1 to {_c::%{_p}%} else: set loop-block to air add 1 to {_d::%{_p}%} function fPotato(l: location, d: number, pz: number, c: number, p: player): loop all blocks in radius ({_pz::%{_p}%} + 4) of {_l::%{_p}%}: if loop-block is fully grown potato plant: play sound "ITEM_CROP_PLANT" at volume 0.7 at pitch 0.3 at location of loop-block if {_c::%{_p}%} > 0: set loop-block to potato plant add 1 to {_d::%{_p}%} add -1 to {_c::%{_p}%} else: set loop-block to air add 1 to {_d::%{_p}%} function fBeetroot(l: location, d: number, pz: number, c: number, p: player): loop all blocks in radius ({_pz::%{_p}%} + 4) of {_l::%{_p}%}: if loop-block is fully grown beetroot plant: play sound "ITEM_CROP_PLANT" at volume 0.7 at pitch 0.3 at location of loop-block if {_c::%{_p}%} > 0: set loop-block to beetroot plant add 1 to {_d::%{_p}%} add -1 to {_c::%{_p}%} else: set loop-block to air add 1 to {_d::%{_p}%}