Represents a cardinal direction (north, south, east, west) and (up and down).

Importing the class

Link to 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.

ZenScript
Copy
import crafttweaker.api.util.Direction;

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

ZenScript
Copy
Direction.north
Direction.south
Direction.east
Direction.west
Direction.up
Direction.down

Static Properties

Link to static-properties

NombreTypeHas GetterHas SetterDescription
Nombre
down
Type
Direction
Has Getter
true
Has Setter
false
Description
No Description Provided
Nombre
east
Type
Direction
Has Getter
true
Has Setter
false
Description
No Description Provided
Nombre
north
Type
Direction
Has Getter
true
Has Setter
false
Description
No Description Provided
Nombre
sides
Type
Direction[]
Has Getter
true
Has Setter
false
Description
No Description Provided
Nombre
south
Type
Direction
Has Getter
true
Has Setter
false
Description
No Description Provided
Nombre
up
Type
Direction
Has Getter
true
Has Setter
false
Description
No Description Provided
Nombre
west
Type
Direction
Has Getter
true
Has Setter
false
Description
No Description Provided

Link to g-

Name: rotateY

Rotates this direction on the Y axis

Returns: the direction that rotated on the Y axis of this direction
Return Type: Direction

ZenScript
Copy
// Direction.rotateY() as Direction

<direction:north>.rotateY();

Link to g--1

Name: rotateYCCW

Rotates this direction counter-clock wise on the Y axis

Returns: the direction that is counter clockwise on the Y axis
Return Type: Direction

ZenScript
Copy
// Direction.rotateYCCW() as Direction

<direction:north>.rotateYCCW();
NombreTypeHas GetterHas SetterDescription
Nombre
axis
Type
DirectionAxis
Has Getter
true
Has Setter
false
Description
Gets the direction axis of this direction
Nombre
axisOffset
Type
int
Has Getter
true
Has Setter
false
Description
Gets the offset of this axis (is it pointing towards position or negative). down is negative, up is positive (-y for down, +y for up)
Nombre
horizontalAngle
Type
float
Has Getter
true
Has Setter
false
Description
Gets the horizontal angle of this direction
Nombre
horizontalIndex
Type
int
Has Getter
true
Has Setter
false
Description
Get the index of this horizontal direction (0-3). The order is S-W-N-E
Nombre
index
Type
int
Has Getter
true
Has Setter
false
Description
Get the Index of this direction (0-5). The order is D-U-N-S-W-E
Nombre
name
Type
string
Has Getter
true
Has Setter
false
Description
Gets the name of this direction
Nombre
opposite
Type
Direction
Has Getter
true
Has Setter
false
Description
Gets the opposite of this Direction (north returns south)
Nombre
xOffset
Type
int
Has Getter
true
Has Setter
false
Description
Gets the X offset of this direction
Nombre
yOffset
Type
int
Has Getter
true
Has Setter
false
Description
Gets the Y offset of this direction
Nombre
zOffset
Type
int
Has Getter
true
Has Setter
false
Description
Gets the Z offset of this direction