Extended Reach Raycast

Reach_Raycast_Extended Reach HIGH +8 score

🎮 Minecraft Gameplay Impact

In vanilla Minecraft, melee combat relies on GameRenderer.updateTargetedEntity() to perform crosshair raycasting. For players in survival mode, the maximum attack distance to acquire an EntityHitResult is capped at 3.0 blocks. Targets situated beyond 3.0 blocks cannot be hit with melee weapons.

Reach_Raycast_Extended flags combat modules that perform independent raycast queries using ProjectileUtil.raycast() with extended reach multipliers. In the SimpleAutoAttack mod (org.simpleautoattack.SimpleAutoAttack.AutoAttack), the method AutoMeleeTick() calculates an extended look vector: float reach = (float)(mc.field_1724.method_7337() ? 4.5 : ...) where creative mode reach of 4.5 blocks is cast to float. It feeds camera.add(rotation.multiply(reach)) into ProjectileUtil.raycast(..., reach * reach). If a valid entity is encountered within that expanded reach boundary, it immediately invokes attackEntity(player, result.getEntity()) (method_2918).

This allows the client to automatically lock on and strike targets at extended range. However, if the target exceeds the server's maximum reach limit, the server will reject the attack packet.

🔍 Functions & APIs Analyzed

ProjectileUtil.raycast / class_1675.method_18075

Performs entity raycasting along a directional vector up to a specified maximum reach squared.

ClientPlayerInteractionManager.attackEntity / method_2918

Dispatches an attack interaction on the targeted entity.

float_constant_min (>= 4.0)

Constant pool floating-point threshold exceeding the 3.0-block survival melee boundary.

⚙️ Decompiled Representation (Vineflower View)

float reach = (float)(mc.field_1724.method_7337() ? 4.5 : (config.limit ? 2.7 : 3.0));
class_243 camera = mc.field_1724.method_5836(1.0F);
class_243 rotation = mc.field_1724.method_5828(1.0F);
class_243 end = camera.method_1031(rotation.field_1352 * reach, rotation.field_1351 * reach, rotation.field_1350 * reach);
class_3966 result = class_1675.method_18075(
   mc.field_1724, camera, end, new class_238(camera, end), e -> !e.method_7325() && e.method_5732(), reach * reach
);
if (result != null && result.method_17782().method_5805()) {
   if (config.limit) {
      Random random = new Random();
      this.nextAttackTime = System.currentTimeMillis() + random.nextInt(config.limitms) + 500L;
   }

   mc.field_1761.method_2918(mc.field_1724, result.method_17782());
   mc.field_1724.method_6104(class_1268.field_5808);
}

🛡️ Bytecode Signature & Static Detection

The detector inspects class constant pools and method instructions, requiring three concurrent elements within the class:

  • A method invocation to raycasting utilities: ProjectileUtil.raycast (Intermediary class_1675.method_18075), ProjectileUtil.getEntityHitResult, Forge func_221273_a, or NeoForge m_37286_.
  • An attack method invocation: ClientPlayerInteractionManager.attackEntity (Intermediary class_636.method_2918, attackEntity, or attack).
  • A float constant of at least 4.0 embedded in the class (representing extended reach distances beyond the standard 3.0-block vanilla survival limit).

The detector operates at class scope. If the custom raycasting calculation and the attack dispatch are separated into distinct helper classes without direct cross-references, or if reach distances are loaded strictly at runtime through dynamic configuration streams without float constants in the class file, this static rule will not match.