Class Raycasting

java.lang.Object
top.girlkisser.lazuli.api.world.Raycasting

public final class Raycasting extends Object
Helpers for performing raycasts.
  • Method Summary

    Modifier and Type
    Method
    Description
    static @Nullable net.minecraft.world.phys.BlockHitResult
    blockRaycast(net.minecraft.world.entity.Entity entity, double reach, boolean hitFluids)
    Performs a block raycast.
    static @Nullable net.minecraft.world.phys.EntityHitResult
    entityRaycast(net.minecraft.world.entity.Entity entity, double reach)
    Performs an entity raycast.
    static net.minecraft.world.phys.HitResult
    raycast(net.minecraft.world.entity.Entity entity, double reach, boolean hitFluids)
    Performs a raycast.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • blockRaycast

      @Nullable public static @Nullable net.minecraft.world.phys.BlockHitResult blockRaycast(net.minecraft.world.entity.Entity entity, double reach, boolean hitFluids)
      Performs a block raycast.
      Parameters:
      entity - The entity to raycast from.
      reach - The maximum distance to check.
      hitFluids - If the raycast should also hit fluids.
      Returns:
      The block that the raycast hit, if any.
    • entityRaycast

      @Nullable public static @Nullable net.minecraft.world.phys.EntityHitResult entityRaycast(net.minecraft.world.entity.Entity entity, double reach)
      Performs an entity raycast.
      Parameters:
      entity - The entity to raycast from.
      reach - The maximum distance to check.
      Returns:
      The entity that the raycast hit, if any.
    • raycast

      public static net.minecraft.world.phys.HitResult raycast(net.minecraft.world.entity.Entity entity, double reach, boolean hitFluids)
      Performs a raycast.
      Parameters:
      entity - The entity to raycast from.
      reach - The maximum distance to check.
      hitFluids - If fluids should be hit.
      Returns:
      The HitResult.