Class RayTraceResult
java.lang.Object
org.bukkit.util.RayTraceResult
The hit result of a ray trace.
Only the hit position is guaranteed to always be available. The availability of the other attributes depends on what got hit and on the context in which the ray trace was performed.
-
Constructor Summary
ConstructorsConstructorDescriptionRayTraceResult(Vector hitPosition) Creates a RayTraceResult.RayTraceResult(Vector hitPosition, BlockFace hitBlockFace) Creates a RayTraceResult.RayTraceResult(Vector hitPosition, Block hitBlock, BlockFace hitBlockFace) Creates a RayTraceResult.RayTraceResult(Vector hitPosition, Entity hitEntity) Creates a RayTraceResult.RayTraceResult(Vector hitPosition, Entity hitEntity, BlockFace hitBlockFace) Creates a RayTraceResult. -
Method Summary
-
Constructor Details
-
RayTraceResult
Creates a RayTraceResult.- Parameters:
hitPosition- the hit position
-
RayTraceResult
-
RayTraceResult
-
RayTraceResult
-
RayTraceResult
-
-
Method Details
-
getHitPosition
Gets the exact position of the hit.- Returns:
- a copy of the exact hit position
-
getHitBlock
Gets the hit block.- Returns:
- the hit block, or
nullif not available
-
getHitBlockFace
Gets the hit block face.- Returns:
- the hit block face, or
nullif not available
-
getHitEntity
Gets the hit entity.- Returns:
- the hit entity, or
nullif not available
-
hashCode
-
equals
-
toString
-