How can I check if a player can visually see another?

Discussion in 'Plugin Development' started by caldabeast, Jun 15, 2012.

Thread Status:
Not open for further replies.
  1. Offline

    sharqman

    For te record, I have no clue how to make plugins and cannot use java properly.

    However, I suggest looking at the coding for zombies/other hostile mobs and see what Mojang used for their A.I.

    not sure if you got what you wanted yet or not.
     
  2. Offline

    chaseoes

  3. Nope, because of two reasons:
    1. The player might not be right under the crosshair but still be inside the FoV
    2. The player might be behind another player but still be in the FoV
    In both cases, the code you linked, would fail.
     
  4. Offline

    Firefly

    I really wish the new method hasLineOfSight(Entity e) did what I thought it did with regards to what this thread was discussing. Rather, it checks if the Entities' "lines of sight" are obstructed by a block.
     
Thread Status:
Not open for further replies.

Share This Page