Home Commands Examples Getting Started With Scripts Global Keywords

Direction

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;

Implemented Interfaces

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

Enum Constants

Direction is an enum. It has 6 enum constants. They are accessible using the code below.

script.zs
<constant:minecraft:direction:down>
<constant:minecraft:direction:up>
<constant:minecraft:direction:north>
<constant:minecraft:direction:south>
<constant:minecraft:direction:west>
<constant:minecraft:direction:east>

Methods

Return Type: Axis

script.zs
// Direction.getAxis() as Axis
myDirection.getAxis();

Return Type: AxisDirection

script.zs
// Direction.getAxisDirection() as AxisDirection
myDirection.getAxisDirection();

Return Type: Direction

script.zs
// Direction.getClockWise() as Direction
myDirection.getClockWise();

Return Type: Direction

script.zs
Direction.getClockWise(axis as Axis) as Direction
ParameterType
Parameter
axis
Type
Axis

Return Type: Direction

script.zs
// Direction.getCounterClockWise() as Direction
myDirection.getCounterClockWise();

Return Type: Direction

script.zs
Direction.getCounterClockWise(axis as Axis) as Direction
ParameterType
Parameter
axis
Type
Axis

Return Type: string

script.zs
// Direction.getName() as string
myDirection.getName();

Return Type: Vec3i

script.zs
// Direction.getNormal() as Vec3i
myDirection.getNormal();

Return Type: Direction

script.zs
// Direction.getOpposite() as Direction
myDirection.getOpposite();

Return Type: Quaternionf

script.zs
// Direction.getRotation() as Quaternionf
myDirection.getRotation();

Return Type: int

script.zs
// Direction.getStepX() as int
myDirection.getStepX();

Return Type: int

script.zs
// Direction.getStepY() as int
myDirection.getStepY();

Return Type: int

script.zs
// Direction.getStepZ() as int
myDirection.getStepZ();

Return Type: boolean

script.zs
Direction.isFacingAngle(degrees as float) as boolean
ParameterType
Parameter
degrees
Type
float

Return Type: Vector3f

script.zs
// Direction.step() as Vector3f
myDirection.step();

Return Type: float

script.zs
// Direction.toYRot() as float
myDirection.toYRot();

Properties

NameTypeHas GetterHas Setter
Name
axis
Type
Axis
Has Getter
true
Has Setter
false
Name
axisDirection
Type
AxisDirection
Has Getter
true
Has Setter
false
Name
clockWise
Type
Direction
Has Getter
true
Has Setter
false
Name
counterClockWise
Type
Direction
Has Getter
true
Has Setter
false
Name
normal
Type
Vec3i
Has Getter
true
Has Setter
false
Name
opposite
Type
Direction
Has Getter
true
Has Setter
false
Name
rotation
Type
Quaternionf
Has Getter
true
Has Setter
false
Name
step
Type
Vector3f
Has Getter
true
Has Setter
false
Name
stepX
Type
int
Has Getter
true
Has Setter
false
Name
stepY
Type
int
Has Getter
true
Has Setter
false
Name
stepZ
Type
int
Has Getter
true
Has Setter
false
Name
toYRot
Type
float
Has Getter
true
Has Setter
false