Vector - MinecraftPhi/MinecraftPhi-modules GitHub Wiki
This module adds functions for manipulating vectors, which are 3 numbers x, y, z. When stored in NBT it is stored as a list of length 3 in the same order. When stored as scores the three components have the same name but with .x, .y, or .z on the end of the fakeplayer name.
Currently there are only functions for getting and setting certain vectors, but there will be arithmetic in the future.
Functions
phi.vector:get_look_nbt, gets the look vector of the@sentity. This is a vector with a length of 1 and is pointing in the direction the entity is looking. The vector is stored instorage phi.vector:temp lookphi.vector:get_look_scoressame asphi.vector:get_look_nbtbut stores the vector in three scores$phi.vector.look temp, with a scale of 2147483647phi.vector:set_looksets the look vector of@sentity using the vector atstorage phi.vector:temp look. This works for entities as well as playersphi.vector:get_pos_nbt, gets the position of the@sentity. The vector is stored instorage phi.vector:temp posphi.vector:get_pos_scoressame asphi.vector:get_pos_nbtbut stores the vector in three scores$phi.vector.pos temp, with a scale of 71. It is not recommended to use this function, because the scale is quite small to support all possible positions. In the future this may be changed to use software floating point.phi.vector:set_possets the position of the@sentity using the vector atstorage phi.vector:temp pos. This works for entities as well as players