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

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

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();

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();
이름TypeHas GetterHas SetterDescription
이름
axis
Type
DirectionAxis
Has Getter
true
Has Setter
false
Description
Gets the direction axis of this direction
이름
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)
이름
horizontalAngle
Type
float
Has Getter
true
Has Setter
false
Description
Gets the horizontal angle of this direction
이름
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
이름
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
이름
name
Type
string
Has Getter
true
Has Setter
false
Description
Gets the name of this direction
이름
opposite
Type
Direction
Has Getter
true
Has Setter
false
Description
Gets the opposite of this Direction (north returns south)
이름
xOffset
Type
int
Has Getter
true
Has Setter
false
Description
Gets the X offset of this direction
이름
yOffset
Type
int
Has Getter
true
Has Setter
false
Description
Gets the Y offset of this direction
이름
zOffset
Type
int
Has Getter
true
Has Setter
false
Description
Gets the Z offset of this direction