is Looking At Entity
Ray-traces from the current camera entity and returns a hit result when the traced entity equals toEntity.
Parameters
to Entity
target entity that must be hit by the ray.
range
maximum ray-trace distance.
rotation
yaw/pitch used to build the ray direction.
fun isLookingAtEntity(fromEntity: Entity = mc.cameraEntity!!, toEntity: Entity, rotation: Rotation, range: Double, throughWallsRange: Double): EntityHitResult?
Ray-traces from fromEntity and validates whether toEntity is hit with the given rotation.
Parameters
from Entity
entity whose eye position is used as ray origin.
to Entity
target entity that must be hit by the ray.
rotation
yaw/pitch used to build the ray direction.
range
maximum non-wall-bypass distance.
through Walls Range
distance that is allowed without line-of-sight.