Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Where x0y0z0 is the mob and x1y1z1 is the target location
- Vector=(x1-x0)i+(y1-y0)j+(z1-z0)k
- Dropping I/J/K because they are essentially just placeholders in this case:
- Vector=(x1-x0)+(y1-y0)+(z1-z0)
- x1-x0=XDIFF
- define XDIFF <context.target.location.x.sub[<context.entity.location.x>]>
- y1-y0=YDIFF
- define YDIFF <context.target.location.y.sub[<context.entity.location.y>]>
- z1-z0=ZDIFF
- define ZDIFF <context.target.location.z.sub[<context.entity.location.z>]>
- Changing +'s to ,s because minecraft:
- Vector=(x1-x0),(y1-y0),(z1-z0)
- Long form of vector
- 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>]>>
- Short form of vector with definitions:
- Vector=<[XDIFF]>,<[YDIFF]>,<[ZDIFF]>
- |Vbar|=Sqrrt[(x1-x0)^2+(y1-y0)^2+(z1-z0)^2]
- Filling in definitions:
- |Vbar|=Sqrrt[<[XDIFF]>^2+<[YDIFF]>^2+<[ZDIFF]>^2]
- Define Vbar as Vmagnitude to save sanity and filling in tags
- Define VMAGNITUDE <element[<[XDIFF]>].power[2].add[<[YDIFF]>.power[2]].add[<[ZDIFF]>.power[2]].sqrt>
- Unit vector= V/VBAR
- 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]
- Filling in defined stuff.
- Unit vector= XDIFF/VMAGNITUDE+YDIFF/VMAGNITUDE+ZDIFF/VMAGNITUDE
- Changing +'s to ,s because minecraft.
- Unit vector= XDIFF/VMAGNITUDE,YDIFF/VMAGNITUDE,ZDIFF/VMAGNITUDE
- Filling in elementtags
- Unit vector= <<[XDIFF]>.div[<[VMAGNITUDE]>],<[yDIFF]>.div[<[VMAGNITUDE]>],<[ZDIFF]>.div[<[VMAGNITUDE]>]>
Advertisement
Add Comment
Please, Sign In to add comment