I will say, to prevent this on your farm, if you can chop trees facing away from the edge of your farm if there close, it may be able to prevent as they won't fall near the edge. But if they do a magnetism ring would be your best bet I would say, I wear one all the time just in case, and also helps with collecting stuff while mining especially if you need to escape quickly but don't want to give up stuff, magnet rings are very useful, especially in that situation when the unreachable areas try to gobble up resources.