Minecraft wiki entry for Guardian, associated text: Once the target is out of range, or if the laser is obstructed by solid blocks (including transparent blocks like glass), the guardian's laser disengages.