how make mob smartly shoot raycast at another mob
Very simple concept. I want to have an mob that fires a raycast at nearby hostile mobs. The issue I’ve ran into in the past is that it tries to shoot at mobs that are behind blocks. Is there an easy way to prevent this from happening? I don’t need exact code or anything, just a brief explanation on how the system would work and what commands are needed.