I was wondering how I could get the player, or mob that was in the player's crosshair... For example, you can do it with blocks with: Code:java Location loc = p.getTargetBlock(null, 100).getLocation(); So I was hoping for something a little like this: Code:java Entity entity = p.getTargetEntity(null, 100).getEntity(); Thanks!
You can get interact events, like if you right click an entity within block place range, but I don't think there's a built-in method to check entities in crosshairs. You will likely need to write your own hitscan, which is a bit tricky but not expert-level hard, so you'll do good to look up some tutorials on hitscans/raycasting.