#How would I do this?
1 messages · Page 1 of 1 (latest)
Get the eye location with LivingEntity#getEyeLocation. You can then ray trace entities from that position in the direction the player is looking with the maximum hit distance as the maximum ray distance.
The ray trace result ends up being the player themeselves in this case?
https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/World.html#rayTraceEntities(org.bukkit.Location,org.bukkit.util.Vector,double,java.util.function.Predicate) you can pass in a predicate to filter out certain entities (which in your case would be the current player)