Eutherin

Untitled

Sep 8th, 2020
157
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.60 KB | None | 0 0
  1. Where x0y0z0 is the mob and x1y1z1 is the target location
  2. Vector=(x1-x0)i+(y1-y0)j+(z1-z0)k
  3.  
  4. Dropping I/J/K because they are essentially just placeholders in this case:
  5. Vector=(x1-x0)+(y1-y0)+(z1-z0)
  6.  
  7. x1-x0=XDIFF
  8. define XDIFF <context.target.location.x.sub[<context.entity.location.x>]>
  9.  
  10. y1-y0=YDIFF
  11. define YDIFF <context.target.location.y.sub[<context.entity.location.y>]>
  12.  
  13. z1-z0=ZDIFF
  14. define ZDIFF <context.target.location.z.sub[<context.entity.location.z>]>
  15.  
  16. Changing +'s to ,s because minecraft:
  17. Vector=(x1-x0),(y1-y0),(z1-z0)
  18.  
  19. Long form of vector
  20. Vector=<context.target.location.x.sub[<context.entity.location.x>]>,<context.target.location.y.sub[<context.entity.location.y>]>,<context.target.location.z.sub[<context.entity.location.z>]>>
  21.  
  22. Short form of vector with definitions:
  23. Vector=<[XDIFF]>,<[YDIFF]>,<[ZDIFF]>
  24.  
  25. |Vbar|=Sqrrt[(x1-x0)^2+(y1-y0)^2+(z1-z0)^2]
  26.  
  27. Filling in definitions:
  28. |Vbar|=Sqrrt[<[XDIFF]>^2+<[YDIFF]>^2+<[ZDIFF]>^2]
  29.  
  30. Define Vbar as Vmagnitude to save sanity and filling in tags
  31. Define VMAGNITUDE <element[<[XDIFF]>].power[2].add[<[YDIFF]>.power[2]].add[<[ZDIFF]>.power[2]].sqrt>
  32.  
  33. Unit vector= V/VBAR
  34. Unit vector=(x1-x0)/(Sqrrt[(x1-x0)^2+(y1-y0)^2+(z1-z0)^2])+(y1-y0)/(Sqrrt[(x1-x0)^2+(y1-y0)^2+(z1-z0)^2])+(z1-z0)/Sqrrt[(x1-x0)^2+(y1-y0)^2+(z1-z0)^2]
  35.  
  36. Filling in defined stuff.
  37. Unit vector= XDIFF/VMAGNITUDE+YDIFF/VMAGNITUDE+ZDIFF/VMAGNITUDE
  38.  
  39. Changing +'s to ,s because minecraft.
  40. Unit vector= XDIFF/VMAGNITUDE,YDIFF/VMAGNITUDE,ZDIFF/VMAGNITUDE
  41.  
  42. Filling in elementtags
  43. Unit vector= <<[XDIFF]>.div[<[VMAGNITUDE]>],<[yDIFF]>.div[<[VMAGNITUDE]>],<[ZDIFF]>.div[<[VMAGNITUDE]>]>
  44.  
  45.  
Advertisement
Add Comment
Please, Sign In to add comment