Minecraft wiki entry for Spider, associated text: If shot with arrows when outside of the detection range, a spider turns and runs in the direction from which the arrow was fired. If the player moves away, the spider continues following the same path unless the player enters the detection range, in which case the spider changes direction and attacks.