94 lines
1.5 KiB
Markdown
94 lines
1.5 KiB
Markdown
# ScriptVector.toArrayString
|
|
|
|
[← ScriptVector](index.md) · [← Master](../../wiki.md)
|
|
|
|
toArrayString()
|
|
Convert this vector to an array string {@code function main(c) { var subject =
|
|
|
|
java.lang.String c.getSubject(); var subjectPosition = subject.getPosition(); c.send("The player is at " +
|
|
subjectPosition.toArrayString() + "!")
|
|
|
|
java.lang.String toString()
|
|
|
|
Methods inherited from class java.lang.Object
|
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
|
|
|
|
Field Detail
|
|
x
|
|
|
|
public double x
|
|
|
|
X coordinate
|
|
|
|
y
|
|
|
|
public double y
|
|
|
|
Y coordinate
|
|
|
|
z
|
|
|
|
public double z
|
|
|
|
Z coordinate
|
|
|
|
Constructor Detail
|
|
ScriptVector
|
|
|
|
public ScriptVector(double x,
|
|
double y,
|
|
double z)
|
|
|
|
ScriptVector
|
|
|
|
public ScriptVector(Vec3d vector)
|
|
|
|
ScriptVector
|
|
|
|
public ScriptVector(BlockPos pos)
|
|
|
|
Method Detail
|
|
toString
|
|
|
|
public java.lang.String toString()
|
|
|
|
Overrides:
|
|
toString in class java.lang.Object
|
|
|
|
toArrayString
|
|
|
|
public java.lang.String toArrayString()
|
|
|
|
Convert this vector to an array string
|
|
|
|
function main(c)
|
|
{
|
|
var subject = c.getSubject();
|
|
var subjectPosition = subject.getPosition();
|
|
c.send("The player is at " + subjectPosition.toArrayString() + "!");
|
|
// The player is at [x, y, z]!
|
|
}
|
|
|
|
|
|
add
|
|
|
|
|
|
|
|
public ScriptVector add(ScriptVector other)
|
|
|
|
subtract
|
|
|
|
public ScriptVector subtract(ScriptVector other)
|
|
|
|
multiply
|
|
|
|
public ScriptVector multiply(double scalar)
|
|
|
|
length
|
|
|
|
public double length()
|
|
|
|
normalize
|
|
|
|
public ScriptVector normalize()
|