RayTraceResult
Link to raytraceresult
Импорт класса
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 Copyimport crafttweaker.api.util.math.RayTraceResult;
Методы
Link to методы
Name: distanceTo
Gets the distance from this RayTraceResult to the given Entity.
Returns: The distance from this result to the given entity.
Return Type: double
ZenScript Copy// RayTraceResult.distanceTo(entity as MCEntity) as double
myRayTraceResult.distanceTo(event.entity);
Параметр | Тип | Описание |
---|---|---|
Параметр entity | Тип MCEntity | Описание The entity to get the distance to. |
Name: getHitVec
Gets the hit vector of this result.
Returns: The hit vector of this result.
Return Type: MCVector3d
ZenScript Copy// RayTraceResult.getHitVec() as MCVector3d
myRayTraceResult.getHitVec();
Name: getType
Gets the type of this RayTraceResult. This can be used to determine if this is a BlockRayTraceResult, an EntityRayTraceResult or if the trace missed.
Returns: The type of this RayTraceResult.
Return Type: RayTraceResultType
ZenScript Copy// RayTraceResult.getType() as RayTraceResultType
myRayTraceResult.getType();
Свойства
Link to свойства
Название | Тип | Имеет Getter | Имеет Setter | Описание |
---|---|---|---|---|
Название hitVec | Тип MCVector3d | Имеет Getter true | Имеет Setter false | Описание Gets the hit vector of this result. |
Название type | Тип RayTraceResultType | Имеет Getter true | Имеет Setter false | Описание Gets the type of this RayTraceResult. This can be used to determine if this is a BlockRayTraceResult, an EntityRayTraceResult or if the trace missed. |