RaytraceResult
Getting a RaytraceResult
RaytraceResultTo get a RaytraceResult object you can use the world namespace.
getType(): String
getType(): StringReturns 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(): Vec3
getHitVec(): Vec3Retrieves 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(): Entity
getEntity(): EntityReturns 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(): BlockPos
getBlockPos(): BlockPosProvides 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
getSideHit(): StringReturns 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.
Raytrace Result Types
MISS
Indicates no object was hit.
BLOCK
Indicates a block was hit.
ENTITY
Indicates an entity was hit.
Last updated