BlockRayTraceResult

Link to blockraytraceresult

Импорт класса

Link to импорт-класса

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.math.BlockRayTraceResult;

Extending RayTraceResult

Link to extending-raytraceresult

BlockRayTraceResult extends RayTraceResult. That means all methods available in RayTraceResult are also available in BlockRayTraceResult

Name: getFace

Gets the face that was hit.

Returns: The face that was hit.
Return Type: Direction

ZenScript
Copy
// BlockRayTraceResult.getFace() as Direction

myBlockRayTraceResult.getFace();

Name: getPos

Gets the position that was hit.

Returns: The position that was hit.
Return Type: BlockPos

ZenScript
Copy
// BlockRayTraceResult.getPos() as BlockPos

myBlockRayTraceResult.getPos();

Name: isInside

Results if the result is inside of a block.

This is used for scaffolding.

Returns: True if it is inside. False otherwise.
Return Type: boolean

ZenScript
Copy
// BlockRayTraceResult.isInside() as boolean

myBlockRayTraceResult.isInside();

Name: withFace

Returns a new BlockRayTraceResult based on this result with the given face.

Returns: a new BlockRayTraceResult based on this result with the given face.
Return Type: BlockRayTraceResult

ZenScript
Copy
// BlockRayTraceResult.withFace(newFace as Direction) as BlockRayTraceResult

myBlockRayTraceResult.withFace(MCDirection.north);
ПараметрТипОписание
Параметр
newFace
Тип
Direction
Описание
The new face.

Name: withPosition

Returns a new BlockRayTraceResult based on this result with the given position.

Returns: a new BlockRayTraceResult based on this result with the given position.
Return Type: BlockRayTraceResult

ZenScript
Copy
// BlockRayTraceResult.withPosition(pos as BlockPos) as BlockRayTraceResult

myBlockRayTraceResult.withPosition(new BlockPos(1, 2, 3));
ПараметрТипОписание
Параметр
pos
Тип
BlockPos
Описание
The new position.

Свойства

Link to свойства

НазваниеТипИмеет GetterИмеет SetterОписание
Название
face
Тип
Direction
Имеет Getter
true
Имеет Setter
false
Описание
Gets the face that was hit.
Название
inside
Тип
boolean
Имеет Getter
true
Имеет Setter
false
Описание
Results if the result is inside of a block.

This is used for scaffolding.
Название
pos
Тип
BlockPos
Имеет Getter
true
Имеет Setter
false
Описание
Gets the position that was hit.