Home Commands Examples Getting Started With Scripts Global Keywords
BracketDumpers BracketHandlers BracketValidators ResourceLocationBracketHandler

HitResult

Importing the class

If you need to reference this type directly, like when casting an Array, or as a parameter, you will need to import it. Simply add the import at the top of the file.

script.zs
import crafttweaker.api.util.HitResult;

Members

distanceTo(entity as Entity) as double
script.zs
// HitResult.distanceTo(entity as Entity) as double;
myHitResult.distanceTo(myEntity);

Parameters:

entity Type: Entity

Return Type: double

Getter
script.zs
// HitResult.location as Vec3
myHitResult.location

Return Type: Vec3

location() as Vec3
script.zs
// HitResult.location() as Vec3;
myHitResult.location();

Return Type: Vec3

Getter
script.zs
// HitResult.type as HitResultType
myHitResult.type

Return Type: HitResultType

type() as Type
script.zs
// HitResult.type() as HitResultType;
myHitResult.type();

Return Type: HitResultType