Home Commands Examples Getting Started With Scripts Global Keywords

Axis

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.direction.Axis;

Implemented Interfaces

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

Enum Constants

Axis is an enum. It has 3 enum constants. They are accessible using the code below.

script.zs
<constant:minecraft:direction/axis:x>
<constant:minecraft:direction/axis:y>
<constant:minecraft:direction/axis:z>

Methods

Return Type: double

script.zs
Axis.choose(x as double, y as double, z as double) as double
ParameterType
Parameter
x
Type
double
Parameter
y
Type
double
Parameter
z
Type
double

Return Type: int

script.zs
Axis.choose(x as int, y as int, z as int) as int
ParameterType
Parameter
x
Type
int
Parameter
y
Type
int
Parameter
z
Type
int

Return Type: string

script.zs
// Axis.getName() as string
myAxis.getName();

Return Type: Plane

script.zs
// Axis.getPlane() as Plane
myAxis.getPlane();

Return Type: boolean

script.zs
// Axis.isHorizontal() as boolean
myAxis.isHorizontal();

Return Type: boolean

script.zs
// Axis.isVertical() as boolean
myAxis.isVertical();

Return Type: boolean

script.zs
Axis.test(direction as Direction?) as boolean
ParameterType
Parameter
direction
Type
Direction?

Properties

NameTypeHas GetterHas Setter
Name
horizontal
Type
boolean
Has Getter
true
Has Setter
false
Name
name
Type
string
Has Getter
true
Has Setter
false
Name
plane
Type
Plane
Has Getter
true
Has Setter
false
Name
vertical
Type
boolean
Has Getter
true
Has Setter
false