Addendum: In the linked solution, the methods were unfortunately outdated, which is why it is useless for me. But basically that's exactly what I'm looking for. The only difference is that I don't want to draw the line from one block to another, but from the center of the player to other monsters.