RayTraceResult can hold entities, but I don't see any being assigned to it except in objectMouseOver(), which is client-only. Someone a little more familiar can probably point you to a method that ray traces entities on the server. However, if you look at the objectMouseOver() method, you can see that it uses the hitVector, which you get from yaw and pitch, the player position, which you have, and a world object, which you also have. So you could adapt the objectMouseOver() method's logic to use