У меня есть функция в RaycastUtils
public static EntityHitResult raycastEntity(final double range, final float yaw, final float pitch, double boxexpand) {
Entity camera = mc.getCameraEntity();
Vec3d pos = mc.player.getEyePos();
final float yawCos = MathHelper.cos(-yaw * 0.017453292F...