Raycast Triggerbot
Minecraft Gameplay Impact
Calculates high-frequency vector raycasts from the player camera eye coordinate to detect targets within custom spherical hit ranges, bypassing vanilla entity picking logic and triggering instant attacks before vanilla crosshair registration.
Functions & APIs Analyzed
ProjectileUtil.raycast
Custom raycast utility (method_18075) calculating vector intersections against bounding boxes.
Entity.raycast
Performs geometric line-of-sight checks through world coordinates (method_5698).
ClientPlayerInteractionManager.attackEntity
Dispatches melee attack (method_2918) upon successful raycast intersection.
Mod Implementation (Dev Source / Mapped)
// Developer Source (Fabric / Yarn mappings)
public class RaycastBot {
public static void checkAndAttack(MinecraftClient client, float reach) {
Vec3d eyePos = client.player.getCameraPosVec(1.0f);
Vec3d rot = client.player.getRotationVec(1.0f);
Vec3d reachVec = eyePos.add(rot.x * reach, rot.y * reach, rot.z * reach);
Box box = client.player.getBoundingBox().stretch(rot.multiply(reach)).expand(1.0);
EntityHitResult hit = ProjectileUtil.raycast(client.player, eyePos, reachVec, box, e -> !e.isSpectator() && e.isAlive(), reach * reach);
if (hit != null && hit.getEntity() instanceof PlayerEntity) {
client.interactionManager.attackEntity(client.player, hit.getEntity());
}
}
}
Decompiled Representation (Vineflower View)
// Decompiled with Vineflower 1.12 (Intermediary mappings)
public class RaycastBot {
public static void checkAndAttack(class_310 client, float reach) {
class_243 eyePos = client.field_1724.method_5836(1.0F);
class_243 rot = client.field_1724.method_5720(1.0F);
class_243 reachVec = eyePos.method_1031(rot.field_1352 * (double)reach, rot.field_1351 * (double)reach, rot.field_1350 * (double)reach);
class_238 box = client.field_1724.method_5829().method_1009(rot.method_1021((double)reach)).method_1009(1.0);
class_3966 hit = class_1675.method_18075(client.field_1724, eyePos, reachVec, box, (e) -> !e.method_7325() && e.method_5805(), (double)(reach * reach));
if (hit != null && hit.method_17782() instanceof class_1657) {
client.field_1761.method_2918(client.field_1724, hit.method_17782());
}
}
}
Bytecode Signature & Static Detection
Identifies references to raycast utilities (ProjectileUtil.raycast / method_18075 or ProjectileUtil.getEntityHitResult) coupled with ClientPlayerInteractionManager.attackEntity (method_2918).