Solved Getting locations along vector value

Discussion in 'Plugin Development' started by Freelix2000, Mar 8, 2015.

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

    Freelix2000

    I am having some trouble with getting a location along a vector direction value. An example of what I am trying to do would be getting a location a block or two in front of a player based on the vector direction, (or yaw works too) but using the target block and line of sight methods won't work for this because they can only get a block and the block's location, not the actual precise location. Does anyone know how to do this?
     
  2. Offline

    blablubbabc

    Maybe player.getEyeLocation().add(vector) ?

    player.getEyeLocation().add(player.getEyeLocation().getDirection().multiply(2)) for the location at 2 blocks length in front of the player
     
    Freelix2000 likes this.
  3. Offline

    Freelix2000

    @blablubbabc
    Thanks, I'll try it.

    Edit: Works perfect, thanks!
     
    Last edited: Mar 9, 2015
Thread Status:
Not open for further replies.

Share This Page