RaytraceResult
Last updated
Last updated
RaytraceResult
To get a RaytraceResult
object you can use the namespace.
getType(): String
Returns the type of hit from the ray trace result. The type is returned as a string and can be one of the following: MISS
, BLOCK
, or ENTITY
.
getHitVec():
Retrieves the hit vector of the ray trace result. This method returns a Vec3Wrapper
object representing the precise location where the ray intersected an object.
getEntity():
Returns an EntityWrapper
object if the ray trace hit an entity. If no entity was hit, the behavior of this method may vary based on implementation (could return null or an empty wrapper).
getBlockPos():
Provides the block position if the ray trace hit a block. This method returns a BlockPos
object representing the location of the block that was hit.
getSideHit(): String
Returns the side of the block that was hit by the ray trace. The side is returned as a string and can be one of the following: DOWN
, UP
, NORTH
, SOUTH
, WEST
, EAST
, NONE
.
MISS
Indicates no object was hit.
BLOCK
Indicates a block was hit.
ENTITY
Indicates an entity was hit.