Vec3

Importing the class

It might be required for you to import the package if you encounter any issues (like casting an Array), so better be safe than sorry and add the import at the very top of the file.

script.zs
import crafttweaker.api.util.math.Vec3;

Implemented Interfaces

Vec3 implements the following interfaces. That means all methods defined in these interfaces are also available in Vec3

Constructors

script.zs
new Vec3(x as double, y as double, z as double) as Vec3
ParameterTypeDescription
Parameter
x
Type
double
Description
No description provided
Parameter
y
Type
double
Description
No description provided
Parameter
z
Type
double
Description
No description provided

Methods

Return Type: Vec3

script.zs
Vec3.add(other as Vec3) as Vec3
ParameterTypeDescription
Parameter
other
Type
Vec3
Description
No Description Provided

Return Type: Vec3

script.zs
Vec3.add(x as double, y as double, z as double) as Vec3
ParameterTypeDescription
Parameter
x
Type
double
Description
No Description Provided
Parameter
y
Type
double
Description
No Description Provided
Parameter
z
Type
double
Description
No Description Provided

Return Type: boolean

script.zs
Vec3.closerThan(position as Position, maxDistance as double) as boolean
ParameterTypeDescription
Parameter
position
Type
Position
Description
No Description Provided
Parameter
maxDistance
Type
double
Description
No Description Provided

Return Type: Vec3

script.zs
Vec3.cross(other as Vec3) as Vec3
ParameterTypeDescription
Parameter
other
Type
Vec3
Description
No Description Provided

Return Type: double

script.zs
Vec3.distanceTo(other as Vec3) as double
ParameterTypeDescription
Parameter
other
Type
Vec3
Description
No Description Provided

Return Type: double

script.zs
Vec3.distanceToSqr(other as Vec3) as double
ParameterTypeDescription
Parameter
other
Type
Vec3
Description
No Description Provided

Return Type: double

script.zs
Vec3.distanceToSqr(x as double, y as double, z as double) as double
ParameterTypeDescription
Parameter
x
Type
double
Description
No Description Provided
Parameter
y
Type
double
Description
No Description Provided
Parameter
z
Type
double
Description
No Description Provided

Return Type: double

script.zs
Vec3.dot(other as Vec3) as double
ParameterTypeDescription
Parameter
other
Type
Vec3
Description
No Description Provided

Return Type: double

script.zs
Vec3.getValue(axis as Axis) as double
ParameterTypeDescription
Parameter
axis
Type
Axis
Description
No Description Provided

Return Type: double

script.zs
// Vec3.horizontalDistance() as double
myVec3.horizontalDistance();

Return Type: double

script.zs
// Vec3.horizontalDistanceSqr() as double
myVec3.horizontalDistanceSqr();

Return Type: double

script.zs
// Vec3.length() as double
myVec3.length();

Return Type: double

script.zs
// Vec3.lengthSqr() as double
myVec3.lengthSqr();

Return Type: Vec3

script.zs
Vec3.lerp(other as Vec3, value as double) as Vec3
ParameterTypeDescription
Parameter
other
Type
Vec3
Description
No Description Provided
Parameter
value
Type
double
Description
No Description Provided

Return Type: Vec3

script.zs
Vec3.multiply(other as Vec3) as Vec3
ParameterTypeDescription
Parameter
other
Type
Vec3
Description
No Description Provided

Return Type: Vec3

script.zs
Vec3.multiply(x as double, y as double, z as double) as Vec3
ParameterTypeDescription
Parameter
x
Type
double
Description
No Description Provided
Parameter
y
Type
double
Description
No Description Provided
Parameter
z
Type
double
Description
No Description Provided

Return Type: Vec3

script.zs
// Vec3.normalize() as Vec3
myVec3.normalize();

Return Type: Vec3

script.zs
// Vec3.reverse() as Vec3
myVec3.reverse();

Return Type: Vec3

script.zs
Vec3.scale(scalar as double) as Vec3
ParameterTypeDescription
Parameter
scalar
Type
double
Description
No Description Provided

Return Type: Vec3

script.zs
Vec3.subtract(other as Vec3) as Vec3
ParameterTypeDescription
Parameter
other
Type
Vec3
Description
No Description Provided

Return Type: Vec3

script.zs
Vec3.subtract(x as double, y as double, z as double) as Vec3
ParameterTypeDescription
Parameter
x
Type
double
Description
No Description Provided
Parameter
y
Type
double
Description
No Description Provided
Parameter
z
Type
double
Description
No Description Provided

Return Type: Vec3

script.zs
Vec3.vectorTo(other as Vec3) as Vec3
ParameterTypeDescription
Parameter
other
Type
Vec3
Description
No Description Provided

Return Type: Vec3

script.zs
Vec3.xRot(pitch as float) as Vec3
ParameterTypeDescription
Parameter
pitch
Type
float
Description
No Description Provided

Return Type: Vec3

script.zs
Vec3.yRot(yaw as float) as Vec3
ParameterTypeDescription
Parameter
yaw
Type
float
Description
No Description Provided

Return Type: Vec3

script.zs
Vec3.zRot(roll as float) as Vec3
ParameterTypeDescription
Parameter
roll
Type
float
Description
No Description Provided

Properties

NameTypeHas GetterHas SetterDescription
Name
horizontalDistance
Type
double
Has Getter
true
Has Setter
false
Description
No Description Provided
Name
horizontalDistanceSqr
Type
double
Has Getter
true
Has Setter
false
Description
No Description Provided
Name
length
Type
double
Has Getter
true
Has Setter
false
Description
No Description Provided
Name
lengthSqr
Type
double
Has Getter
true
Has Setter
false
Description
No Description Provided
Name
normalize
Type
Vec3
Has Getter
true
Has Setter
false
Description
No Description Provided
Name
reverse
Type
Vec3
Has Getter
true
Has Setter
false
Description
No Description Provided