Skip to main content
2 of 2
deleted 9 characters in body; edited title; edited tags
user avatar
user avatar

How can I get the entity a player is looking at in a Bukkit plugin?

I'm creating a wizardry plugin for Minecraft, and I was wondering how you would get the entity that a player was looking at, I know that you would have to use a Vector, but I really am not familiar with them. Pretty much what I'm looking for is something like this:

public void entityLookingAt(Player p){
    if(p.EntityLookingAt() instanceof Player){
        p.sendMessage("You're looking at a player!");
    }
}
Jojodmo
  • 113
  • 6