funkemunky-KauriV3 KillAura (Trace): Full Source Analysis
KATrace is Kauri's killaura check for attacks through solid blocks, registered as 'KillAura (Trace)' (checkId katrace, CheckType.KILLAURA) and bound to WrapperPlayClientInteractEntity…
Published 2026-08-12 · Updated 2026-08-12
Packets This Module Uses
Analysis
Overview
KATrace is Kauri's killaura check for attacks through solid blocks, registered as 'KillAura (Trace)' (checkId katrace, CheckType.KILLAURA) and bound to WrapperPlayClientInteractEntity - the serverbound interact packet (C02) - so it only ever runs on ATTACK actions against a current target. It reconstructs the player's view server-side: the ray origin is the movement 'to' location raised by the player's eye height, the direction comes from origin.getDirection() (the yaw/pitch of the last movement packet), and a RayCollision computes the entry point of that ray on the target's server-tracked bounding box. The check then tests the same ray against the block collision boxes that MovementProcessor already collected for the look ray: only integer-aligned SimpleCollisionBoxes (full blocks; stairs/slabs/snow sub-boxes are skipped) shrunk by 0.005 per axis count, and any block intersect closer than the target hit minus 0.2 in squared distance means the attack crossed a block first. A buffer smooths false positives: 'Attacker hit through block!' fires only once the buffer exceeds 2, clean attacks decrement it, and an empty looking-at list resets it outright.
Detection model
The check is a single ray tested against two box sets. First the target: the entity is fetched from the world tracker by the current target's entity id, its bounding box is built with EntityData.getEntityBox, and RayCollision.collisionPoint(targetBox) returns the entry point of the eye ray on that AABB. The distance is kept squared - originVec.distanceSquared(targetPoint) - with the source comment noting the square root is skipped for performance. Then the block set: the synchronized walk over player.getMovement().getLookingAtBoxes() filters to SimpleCollisionBox instances whose min/max are all integer-aligned (line 80-81), which excludes partial boxes like slabs, stairs and snow layers and leaves only full blocks; each candidate is shrunk 0.005 per axis 'since there is a bit of a margin of error in the ray trace' and re-intersected with the same ray. A hit counts as a blocked attack only when its squared distance is less than dist - 0.2 - i.e. the ray meets solid geometry more than ~0.45 blocks (sqrt of 0.2) before it reaches the target box - so grazing a block edge inside the epsilon does not count. The ray itself is the server's reconstruction from the movement stream, not the client's render view: the direction is KLocation.getDirection() of the last movement 'to' location, which is why a killaura that aims its C02 at an entity through a wall while the movement yaw/pitch points into the wall is exactly what this check exposes.
Buffer and flag shaping
The buffer is the only state, and every path through the handler touches it. When the player's ray intersects no block boxes at all - getLookingAtBoxes() is empty - the check cannot evaluate and resets buffer to 0 (lines 39-43), so a player who never faces a wall can never accumulate. On a detected block-crossing attack the buffer increments and the flag fires only when ++buffer > 2 (lines 95-100): two prior blocked attacks must have been observed, which absorbs the occasional legitimate edge-clip where the 0.005 shrink and the 0.2 margin disagree with the true hitbox. Clean attacks (no block collision) decay the buffer with buffer-- (line 101), so a stretch of legitimate combat drains the ledger at one point per attack rather than resetting it. The flag message embeds both the buffer and the size of the looking-at list ('Attacker hit through block! [b=%s s=%s]'), and debug() logs the per-attack state, which makes the check's sensitivity tunable from the violation data alone. The early returns are strict: no target, non-ATTACK action, empty box list, untracked entity, null target box, and a ray that misses the target box entirely all bail before the buffer is touched, so the buffer can only ever be fed by genuine ATTACK packets whose ray reached the target.
Packet-observation pipeline
KATrace is deliberately lazy about geometry. The comment at lines 75-76 states that the ray-vs-block scan is 'already grabbed in MovementProcessor' and reused here to save compute: the looking-at box list is populated once per movement packet by the movement processor's own ray trace, and KATrace consumes it under a synchronized lock (line 77) rather than re-casting the ray against the world. The per-attack cost is therefore one AABB intersection against the target box plus a linear scan of a small box list. The bound event is WrapperPlayClientInteractEntity, so the check observes the C02-equivalent stream only, and the box list it reads reflects the server's last processed movement - the look state at the time of the previous movement packet, which in 1.8 arrives ahead of the attack packet. The eye origin (line 55-58) is the movement 'to' location cloned and raised by player.getEyeHeight(), which is pose-aware in Kauri, so a sneaking attacker's ray starts 1.54 blocks up and a standing attacker's at 1.62, matching the hardcoded heights used by the sibling KACalc listener. The target box comes from EntityData.getEntityBox with the tracked entity's interpolated location, giving the check a lag-aware target AABB to intersect.
source KATrace.java (the check)
| 1 | |
| 2 | |
| 3 | |
| 4 | |
| 5 | |
| 6 | |
| 7 | |
| 8 | |
| 9 | |
| 10 | |
| 11 | |
| 12 | |
| 13 | |
| 14 | |
| 15 | |
| 16 | |
| 17 | |
| 18 | |
| 19 | |
| 20 | |
| 21 | |
| 22 | |
| 23 | |
| 24 | |
| 25 | |
| 26 | |
| 27 | |
| 28 | |
| 29 | |
| 30 | |
| 31 | |
| 32 | |
| 33 | |
| 34 | |
| 35 | |
| 36 | |
| 37 | |
| 38 | |
| 39 | |
| 40 | |
| 41 | |
| 42 | |
| 43 | |
| 44 | |
| 45 | |
| 46 | |
| 47 | |
| 48 | |
| 49 | |
| 50 | |
| 51 | |
| 52 | |
| 53 | |
| 54 | |
| 55 | |
| 56 | |
| 57 | |
| 58 | |
| 59 | |
| 60 | |
| 61 | |
| 62 | |
| 63 | |
| 64 | |
| 65 | |
| 66 | |
| 67 | |
| 68 | |
| 69 | |
| 70 | |
| 71 | |
| 72 | |
| 73 | |
| 74 | |
| 75 | |
| 76 | |
| 77 | |
| 78 | |
| 79 | |
| 80 | |
| 81 | |
| 82 | |
| 83 | |
| 84 | |
| 85 | |
| 86 | |
| 87 | |
| 88 | |
| 89 | |
| 90 | |
| 91 | |
| 92 | |
| 93 | |
| 94 | |
| 95 | |
| 96 | |
| 97 | |
| 98 | |
| 99 | |
| 100 | |
| 101 | |
| 102 | |
| 103 | |
| 104 | |
| 105 | |
What this file does
The check is 105 lines and one bound action. The @CheckData declaration (line 23) registers it as 'KillAura (Trace)' with checkId katrace under CheckType.KILLAURA. The bound useEntity handler (lines 33-104) opens with the four bails: no current target, non-ATTACK interact action, an empty looking-at box list (which resets the buffer, lines 39-43), and an untracked target entity (lines 45-49). The target geometry is built at lines 51-53 via EntityData.getEntityBox on the tracked entity's location. The ray is constructed at lines 55-63: the movement 'to' location is cloned, raised by the eye height, and turned into a RayCollision with the direction from KLocation.getDirection(); the collision point on the target box is found at line 65 and the squared distance to it computed at line 71. The block scan (lines 73-93) is the core: under synchronized access it walks the MovementProcessor-provided box list, keeps only integer-aligned SimpleCollisionBoxes, shrinks each by 0.005, re-intersects, and compares squared distances with the dist - 0.2 margin. The buffer logic (lines 95-101) and the flag/debug messages (lines 98-103) close the handler. The design note at lines 75-76 - that the box list is computed once in MovementProcessor and reused to save compute - explains why the check has no world access of its own and why the per-attack cost is so low.
source KACalc.java (companion calc listener)
| 1 | |
| 2 | |
| 3 | |
| 4 | |
| 5 | |
| 6 | |
| 7 | |
| 8 | |
| 9 | |
| 10 | |
| 11 | |
| 12 | |
| 13 | |
| 14 | |
| 15 | |
| 16 | |
| 17 | |
| 18 | |
| 19 | |
| 20 | |
| 21 | |
| 22 | |
| 23 | |
| 24 | |
| 25 | |
| 26 | |
| 27 | |
| 28 | |
| 29 | |
| 30 | |
| 31 | |
| 32 | |
| 33 | |
| 34 | |
| 35 | |
| 36 | |
| 37 | |
| 38 | |
| 39 | |
| 40 | |
| 41 | |
| 42 | |
| 43 | |
| 44 | |
| 45 | |
| 46 | |
| 47 | |
| 48 | |
| 49 | |
| 50 | |
| 51 | |
| 52 | |
| 53 | |
| 54 | |
| 55 | |
| 56 | |
| 57 | |
| 58 | |
| 59 | |
| 60 | |
| 61 | |
| 62 | |
| 63 | |
| 64 | |
| 65 | |
| 66 | |
| 67 | |
| 68 | |
| 69 | |
What this file does
KACalc is the only other file in the killaura/calc package, and it is worth being precise about the relationship: KATrace does not call it. KATrace performs its own ray collision through the utils RayCollision class plus the MovementProcessor box list, while KACalc is the sibling listener that computes the rotation statistics consumed by the other two checks in the family, KAZero and KAGrid. Bound to WrapperPlayClientPlayerFlying (the movement packet), it fires only when a target exists and was attacked within 40 ticks (line 33), then computes the yaw/pitch offsets from the eye origin - the movement 'to' location raised by a hardcoded 1.54 (sneaking) or 1.62 (standing) - to the target's current interpolated location, appends them to two 10-entry EvictingLists (lines 55-56), and once full computes their standard deviations (lines 60-63) before handing the offset, rotation and stdev tuples to KAZero and KAGrid via find(). It shares the eye-origin geometry with KATrace but serves a different purpose: its stdev outputs feed the rotation-smoothing checks, and its presence in the calc package is why the package exists - to keep the pure-math killaura helpers out of the check classes. The precise shared pipeline detail (the same sneak-adjusted eye height, the same movement 'to' origin) is what makes the two listeners complementary views of the same attack geometry.