Package top.girlkisser.lazuli.api.world
Class Raycasting
java.lang.Object
top.girlkisser.lazuli.api.world.Raycasting
Helpers for performing raycasts.
-
Method Summary
Modifier and TypeMethodDescriptionstatic @Nullable net.minecraft.world.phys.BlockHitResultblockRaycast(net.minecraft.world.entity.Entity entity, double reach, boolean hitFluids) Performs a block raycast.static @Nullable net.minecraft.world.phys.EntityHitResultentityRaycast(net.minecraft.world.entity.Entity entity, double reach) Performs an entity raycast.static net.minecraft.world.phys.HitResultraycast(net.minecraft.world.entity.Entity entity, double reach, boolean hitFluids) Performs a raycast.
-
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.
-