# [1.8] Getting a Vec3 directed towards an entity?

## Recommended Posts

I'm trying (and failing) to get a Vec3 that's pointed towards an entity from another entity's perspective, without bringing its look vec in to consideration. This is probably really simple, but I can't figure it out. How?

##### Share on other sites

Hi

For background info it might help to find an online introductory course into vector maths, just the simple stuff like adding & subtracting vectors, length, multiplying by a length, calculating angles between them, that sort of thing.  A lot of minecraft stuff is based on vectors...

deltaVector = targetPositionVector - originPositionVector

targetVector is the entity being looked at.

for example

Entity1 = origin = located at [5, 4, 3]

Entity2 = target (being looked at) = located at [10, 11, 1]

the vector pointed from Entity1 toward Entity2 is

[10-5, 11-4, 1-3] = [5, 7, -2]

-TGG

## Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.

×   Pasted as rich text.   Restore formatting

Only 75 emoji are allowed.

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

• ### Posts

• dfdsfgfsdffsd
• ¿Alguien sabe cómo solucionar este fallo? Es del servidor java que te proporciona minecraft, cuando lanzó todos los mods esto no sucede. Yo uso el lanzador original del juego. Un día estaba jugando normalmente y después de 3 días quiero volver a abrir el servidor y no me deja. Aquí les dejo el error.
• Yeah i had something similar and the same problem is happening:It only triggers when in a gui (pause menu, inventory etc) is on the screen. So that was my main need of help. Do i need to make "a class to render the effect on", if that makes sense? Thanks for the render code though, with a few tweaks it will look amazing. EDIT: If im not mistaken that's the expected reulst of the event used? But as I said this is my first time tinkering with player-side rendering.
• You install forge into .minecraft, as that is where the game is installed, so all versions are installed there. You set the directory for each actual game instance, under the Installations heading within the launcher. That's where you'd specify the directory for the version you're playing, per Installation/Profile/call it what you will.

• ### Who's Online (See full list)

×

• #### Activity

×
• Create New...