Memeware 7.3 Kill Aura module 4 files, 250 lines

Memeware 7.3 Kill Aura: Full Source Analysis

Memeware 7.3's Kill Aura is a blockhit-styled melee aura built around a release-attack-reblock cycle.

me/memewaredevs/client/module/combat/aura/SingleAura.java · GitHub source ↗

Published 2026-08-12 · Updated 2026-08-12

Analysis

Overview

Memeware 7.3's Kill Aura is a blockhit-styled melee aura built around a release-attack-reblock cycle. The Aura module registers a single 'Kill Aura' toggle with Single/Multi/Hypixel modes, and SingleAura.doUpdate drives the Single mode from every UpdateEvent (pre and post phases): while a target is in range it snaps both yaw and pitch to the target on every tick, releases the held item with a C07 dig packet, swings and sends the C02PacketUseEntity ATTACK, then re-blocks with a C08 use-item placement on the following tick. Attack cadence comes from one shared Timer at 1000 / Click Speed milliseconds (12-20 CPS default 12), and targeting is the first EntityLivingBase in the loaded entity list within range (default 6, up to 8) with no line-of-sight test, so hits land through walls and the Players/Monsters/Animals toggles are never actually read by the Single path.

Architecture

The Aura module (module/combat/Aura.java) registers 'Kill Aura' with the settings Click Speed (12, 1-20), Block Chance (60), Range (6, 1-8), Auto Block (on), Keep Sprint, Players/Animals/Monsters/Invisibles/Teams, and dispatches its onUpdate handler to SingleAura, MultiAura or HypixelAura by mode. SingleAura is a static helper: doUpdate is called once per UpdateEvent and branches on e.isPre() and e.isPost() to order the blockhit state machine. Module state is entirely static - a shared Timer, the booleans block/unblock/unblocked, and Aura.isBlocking / Aura.currentEntity - so mode switches share one clock and one flag set. Several registered settings are never read on the Single path: Block Chance, Keep Sprint and Teams are ignored, and CombatUtil.getTarget does not consult the Players/Monsters/Animals flags at all, so Single mode attacks any living entity. onDisable resets the statics and, when SingleAura.unblock is set, sends a C07 RELEASE_USE_ITEM at a nearby air position so the player is not left visually blocking.

Blockhit state machine

The cycle is driven by two flags. block starts true; on a post-phase update, if Aura.isBlocking (sword in hand, Auto Block on, and CombatUtil.canBlock finds a target within range + 4) and block is set, the module sends C08PacketPlayerBlockPlacement with the fixed BlockPos(-0.2223, -0.132, -0.312), facing 255, the held item and a 0.0F hit vector - the classic 'use item on air' right-click - and sets the public unblock flag that the module's onDisable consumes. block is unconditionally reset to true at the top of the next update, so the C08 re-fires on every post phase while a target exists, keeping the sword raised. The attack is gated by unblocked: when timer.delay(1000L / clickSpeed) fires on a pre-phase update the module sends C07PacketPlayerDigging RELEASE_USE_ITEM at a.offsetDown() (the same fixed position with Y minus one), sets unblocked = true, block = false, and resets the timer; on the following update, swingItem() plus a C02PacketUseEntity ATTACK are sent and unblocked clears. Each cycle is therefore C07 release, C0A swing + C02 attack, C08 re-block, repeated at Click Speed cycles per second, and because the C02 only fires on the update after a release, the module never attacks from the blocking state. AutoPotion.isPotting() short-circuits the whole pass so potting and attacking never interleave.

Aim and targeting

Target selection is CombatUtil.getTarget, which iterates mc.theWorld.loadedEntityList and returns the first EntityLivingBase within range that is alive, not the player, not in the static bot list, and not invisible (unless Invisibles is on). There is no canEntityBeSeen call and no sorting, so the chosen target is whichever living entity the entity list happens to expose first - not necessarily the nearest - and walls never block a hit. Aim is RotationUtils.getRotations, which targets ent.posY + ent.getEyeHeight() / 2.0F from a fixed eye height of the player's posY + 1.2 and returns both yaw and pitch; doUpdate writes both into the UpdateEvent via setYaw/setPitch, so the client's next movement packet carries a fully snapped look on every tick a target is held. Because the C02 ATTACK is sent on the same tick the look was overwritten, the server-side hit-scan direction and the attack are tick-aligned - exactly the signature that rotation-pattern checks look for.

source SingleAura.java (blockhit attack state machine)

SingleAura.java66 lines · JavaOriginal ↗
1
2
package me.memewaredevs.client.module.combat.aura;
3
4
import me.memewaredevs.client.event.events.UpdateEvent;
5
import me.memewaredevs.client.module.combat.Aura;
6
import me.memewaredevs.client.module.combat.AutoPotion;
7
import me.memewaredevs.client.util.combat.CombatUtil;
8
import me.memewaredevs.client.util.combat.RotationUtils;
9
import me.memewaredevs.client.util.misc.Timer;
10
import me.memewaredevs.client.util.packet.PacketUtil;
11
import net.minecraft.client.Minecraft;
12
import net.minecraft.entity.Entity;
13
import net.minecraft.entity.EntityLivingBase;
14
import net.minecraft.item.ItemSword;
15
import net.minecraft.network.play.client.C02PacketUseEntity;
16
import net.minecraft.network.play.client.C07PacketPlayerDigging;
17
import net.minecraft.network.play.client.C08PacketPlayerBlockPlacement;
18
import net.minecraft.util.BlockPos;
19
import net.minecraft.util.EnumFacing;
20
21
public class SingleAura {
22
    private static Timer timer = new Timer();
23
    private static boolean block;
24
    public static boolean unblock;
25
    private static boolean unblocked;
26
    public static void doUpdate(final Aura aura, final UpdateEvent e, final Minecraft mc) {
27
        boolean invisible = aura.getBool("Invisibles");
28
        double range = aura.getDouble("Range");
29
        boolean players = aura.getBool("Players");
30
        boolean monsters = aura.getBool("Monsters");
31
        boolean teams = false;
32
        final Entity entity = CombatUtil.getTarget(teams, monsters, players, range, invisible);
33
        final boolean autoBlock = aura.getBool("Auto Block");
34
        final long clickSpeed = aura.getDouble("Click Speed").longValue();
35
        Aura.isBlocking = mc.thePlayer.getHeldItem() != null
36
                && mc.thePlayer.getHeldItem().getItem() instanceof ItemSword && autoBlock && CombatUtil.canBlock(
37
                teams, false, true, range + 4.0, true);
38
        BlockPos a = new BlockPos(-0.2223, -0.132, -0.312);
39
        if (Aura.isBlocking) {
40
            if (e.isPost() && block) {
41
                PacketUtil.sendPacket(new C08PacketPlayerBlockPlacement(a, 255, mc.thePlayer.getHeldItem(), 0.0F, 0.0F, 0.0F));
42
                unblock = true;
43
            }
44
        }
45
        block = true;
46
        if (AutoPotion.isPotting())
47
            return;
48
        Aura.currentEntity = (EntityLivingBase) entity;
49
        if (entity != null) {
50
            final float[] rots = RotationUtils.getRotations((EntityLivingBase) entity);
51
            e.setYaw(rots[0]);
52
            e.setPitch(rots[1]);
53
            if (unblocked) {
54
                mc.thePlayer.swingItem();
55
                PacketUtil.sendPacket(new C02PacketUseEntity(entity, C02PacketUseEntity.Action.ATTACK));
56
                unblocked = false;
57
            }
58
            if (timer.delay(1000L / clickSpeed) && e.isPre()) {
59
                PacketUtil.sendPacket(new C07PacketPlayerDigging(C07PacketPlayerDigging.Action.RELEASE_USE_ITEM, a.offsetDown(), EnumFacing.UP));
60
                unblocked = true;
61
                block = false;
62
                timer.reset();
63
            }
64
        }
65
    }
66
}

What this file does

doUpdate is the whole module: it computes isBlocking from the sword/auto-block/canBlock conditions, runs the C08 place on the post phase when block is true, unconditionally re-arms block, skips when AutoPotion.isPotting(), and for a live target writes RotationUtils.getRotations into the event before checking the unblocked gate. The attack itself is two lines - swingItem() then C02PacketUseEntity ATTACK - and fires only on the update that follows a timer-driven C07 RELEASE_USE_ITEM. The fixed BlockPos(-0.2223, -0.132, -0.312) with facing 255 is the 'use item on air' trick that makes the C08 a block instead of a placement, and the same position offset down one block is used for the release dig, so the whole state machine works without touching a real block. Because the timer is a single static Timer shared across all mode switches, the cadence continues even if the mode is toggled mid-fight.

source Aura.java (module shell and mode dispatch)

Aura.java60 lines · JavaOriginal ↗
1
2
package me.memewaredevs.client.module.combat;
3
4
import java.util.function.Consumer;
5
6
import me.hippo.api.lwjeb.annotation.Handler;
7
import me.memewaredevs.client.event.events.UpdateEvent;
8
import me.memewaredevs.client.module.Module;
9
import me.memewaredevs.client.module.combat.aura.HypixelAura;
10
import me.memewaredevs.client.module.combat.aura.MultiAura;
11
import me.memewaredevs.client.module.combat.aura.SingleAura;
12
import me.memewaredevs.client.util.packet.PacketUtil;
13
import net.minecraft.entity.EntityLivingBase;
14
import net.minecraft.network.play.client.C07PacketPlayerDigging;
15
import net.minecraft.util.BlockPos;
16
import net.minecraft.util.EnumFacing;
17
18
public class Aura extends Module {
19
20
	public static boolean isBlocking;
21
	public static EntityLivingBase currentEntity;
22
23
	public Aura() {
24
		super("Kill Aura", 19, Module.Category.COMBAT);
25
		addModes("Single", "Multi", "Hypixel");
26
		addInt("Click Speed", 12.0, 1.0, 20.0);
27
		addInt("Block Chance", 60.0, 1.0, 100.0);
28
		addDouble("Range", 6.0, 1.0, 8.0);
29
		addBoolean("Auto Block", true);
30
		addBoolean("Keep Sprint", true);
31
		addBoolean("Players", true);
32
		addBoolean("Animals", true);
33
		addBoolean("Monsters", true);
34
		addBoolean("Invisibles", true);
35
		addBoolean("Teams", true);
36
	}
37
38
	@Handler
39
	public Consumer<UpdateEvent> onUpdate = (event) -> {
40
		if (isMode("Single")) {
41
			SingleAura.doUpdate(this, event, mc);
42
		}
43
		if (isMode("Multi")) {
44
			MultiAura.doUpdate(this, event, mc);
45
		}
46
		if (isMode("Hypixel")) {
47
			HypixelAura.doUpdate(this, event, mc);
48
		}
49
	};
50
51
	@Override
52
	public void onDisable() {
53
		isBlocking = false;
54
		currentEntity = null;
55
		if (SingleAura.unblock) {
56
			PacketUtil.sendPacket(new C07PacketPlayerDigging(C07PacketPlayerDigging.Action.RELEASE_USE_ITEM,
57
					new BlockPos(0.221, 0.221, 0.213), EnumFacing.UP));
58
		}
59
	}
60
}

What this file does

The module shell that registers 'Kill Aura', its settings and the Single/Multi/Hypixel mode selector, and forwards every UpdateEvent to SingleAura.doUpdate. It also owns the static Aura.isBlocking and Aura.currentEntity that SingleAura writes, and its onDisable sends the C07 RELEASE_USE_ITEM at BlockPos(0.221, 0.221, 0.213) when SingleAura.unblock is set - the unblock flag is set on the C08 path, so a disable mid-cycle always releases the sword. Note that Block Chance, Keep Sprint and Teams are registered here but never consumed by SingleAura, and the ModeSetting default is 'Single'.

source CombatUtil.java (target selection)

CombatUtil.java59 lines · JavaOriginal ↗
1
2
package me.memewaredevs.client.util.combat;
3
4
import me.memewaredevs.client.util.misc.MinecraftUtil;
5
import net.minecraft.entity.Entity;
6
import net.minecraft.entity.EntityLivingBase;
7
import net.minecraft.entity.player.EntityPlayer;
8
9
import java.util.ArrayList;
10
import java.util.List;
11
12
public class CombatUtil implements MinecraftUtil {
13
    public static List botList = new ArrayList();
14
15
    public static Entity getTarget(boolean teams, final boolean mobs, final boolean players, final double range, final boolean invis) {
16
        for (final Object obj : mc.theWorld.loadedEntityList) {
17
            EntityLivingBase o;
18
            if (!(obj instanceof EntityLivingBase)
19
                    || (o = (EntityLivingBase) obj).getDistanceToEntity(mc.thePlayer) > range
20
                    || o.isInvisible() && !invis || o.isDead() || o.getHealth() == 0.0f || o == mc.thePlayer
21
                    || botList.contains(o))
22
                continue;
23
            return o;
24
        }
25
        return null;
26
    }
27
28
    public static boolean canBlock(boolean teams, final boolean mobs, final boolean players, final double range, final boolean invis) {
29
        for (final Object obj : mc.theWorld.loadedEntityList) {
30
            EntityLivingBase o;
31
            if (!(obj instanceof EntityLivingBase)
32
                    || (o = (EntityLivingBase) obj).getDistanceToEntity(mc.thePlayer) > range
33
                    || o.isInvisible() && !invis || o.isDead()
34
                    || o == mc.thePlayer || botList.contains(o) || !(o instanceof EntityPlayer) && players) {
35
                continue;
36
            }
37
38
            return true;
39
        }
40
        return false;
41
    }
42
43
    public static List<EntityLivingBase> getTargets(boolean teams, final int maxTargets, final boolean mobs, final boolean players, final double range,
44
                                                    final boolean invis) {
45
        final ArrayList<EntityLivingBase> list = new ArrayList<>();
46
        for (final Object obj : mc.theWorld.loadedEntityList) {
47
            EntityLivingBase o;
48
            if (!(obj instanceof EntityLivingBase)
49
                    || (o = (EntityLivingBase) obj).getDistanceToEntity(mc.thePlayer) > (((EntityLivingBase) obj).posY > mc.thePlayer.posY + 1 ? range + 2 : range)
50
                    || o.isInvisible() && !invis || o.isDead() || o.getHealth() == 0.0f || o == mc.thePlayer
51
                    || botList.contains(o)) continue;
52
            if (!(obj instanceof EntityPlayer)) continue;
53
            if (list.size() >= maxTargets) continue;
54
            list.add(o);
55
        }
56
        return list;
57
    }
58
59
}

What this file does

getTarget is the unsorted first-match scan of the loaded entity list that the aura relies on: any EntityLivingBase within range that is alive, not the player and not on the static botList qualifies. The mobs and players parameters are accepted but never read, which is why Single mode hits animals and monsters regardless of the module's Players/Monsters/Animals toggles. canBlock repeats the scan with a range + 4 margin and is what gates the auto-block C08, and getTargets (used by the Multi mode) adds a two-block vertical range bonus for targets above the player.

source RotationUtils.java (aim math)

RotationUtils.java65 lines · JavaOriginal ↗
1
2
package me.memewaredevs.client.util.combat;
3
4
import me.memewaredevs.client.util.blocks.position.Vec3d;
5
import me.memewaredevs.client.util.misc.MinecraftUtil;
6
import net.minecraft.client.Minecraft;
7
import net.minecraft.entity.Entity;
8
import net.minecraft.entity.EntityLivingBase;
9
import net.minecraft.util.MathHelper;
10
11
public class RotationUtils {
12
13
	static {
14
15
	}
16
17
	public static float[] getRotations(EntityLivingBase ent) {
18
		double x = ent.posX;
19
		double y = ent.posY + ent.getEyeHeight() / 2.0f;
20
		double z = ent.posZ;
21
		return RotationUtils.getRotationFromPosition(x, y, z);
22
	}
23
24
	public static float[] doScaffoldRotations(Vec3d vec) {
25
		double diffX = vec.xCoord - MinecraftUtil.mc.thePlayer.posX;
26
		double diffY = vec.yCoord - (MinecraftUtil.mc.thePlayer.boundingBox.minY);
27
		double diffZ = vec.zCoord - MinecraftUtil.mc.thePlayer.posZ;
28
		double dist = MathHelper.sqrt(diffX * diffX + diffZ * diffZ);
29
		float yaw = (float) (Math.toDegrees(Math.atan2(diffZ, diffX)));
30
		float pitch = (float) -Math.toDegrees(Math.atan2(diffY, dist));
31
		return new float[] {
32
				MinecraftUtil.mc.thePlayer.rotationYaw
33
						+ MathHelper.wrapAngleTo180_float(yaw - MinecraftUtil.mc.thePlayer.rotationYaw),
34
				MinecraftUtil.mc.thePlayer.rotationPitch
35
						+ MathHelper.wrapAngleTo180_float(pitch - MinecraftUtil.mc.thePlayer.rotationPitch) };
36
	}
37
38
	public static float[] getBowAngles(Entity entity) {
39
		double xDelta = entity.posX - entity.lastTickPosX;
40
		double zDelta = entity.posZ - entity.lastTickPosZ;
41
		double d = Minecraft.getMinecraft().thePlayer.getDistanceToEntity(entity) % 0.8;
42
		boolean sprint = entity.isSprinting();
43
		double xMulti = d / 0.8 * xDelta * (sprint ? 1.25 : 1.0);
44
		double zMulti = d / 0.8 * zDelta * (sprint ? 1.25 : 1.0);
45
		double x = entity.posX + xMulti - Minecraft.getMinecraft().thePlayer.posX;
46
		double z = entity.posZ + zMulti - Minecraft.getMinecraft().thePlayer.posZ;
47
		double y = Minecraft.getMinecraft().thePlayer.posY + Minecraft.getMinecraft().thePlayer.getEyeHeight()
48
				- (entity.posY + entity.getEyeHeight());
49
		double dist = Minecraft.getMinecraft().thePlayer.getDistanceToEntity(entity);
50
		float yaw = (float) Math.toDegrees(Math.atan2(z, x)) - 90.0f;
51
		float pitch = (float) Math.toDegrees(Math.atan2(y, dist));
52
		return new float[] { yaw, pitch };
53
	}
54
55
	public static float[] getRotationFromPosition(double x, double y, double z) {
56
		double xDiff = x - Minecraft.getMinecraft().thePlayer.posX;
57
		double zDiff = z - Minecraft.getMinecraft().thePlayer.posZ;
58
		double yDiff = y - Minecraft.getMinecraft().thePlayer.posY - 1.2;
59
60
		double dist = MathHelper.sqrt_double(xDiff * xDiff + zDiff * zDiff);
61
		float yaw = (float) (Math.atan2(zDiff, xDiff) * 180.0D / 3.141592653589793D) - 90.0F;
62
		float pitch = (float) -(Math.atan2(yDiff, dist) * 180.0D / 3.141592653589793D);
63
		return new float[] { yaw, pitch };
64
	}
65
}

What this file does

getRotations aims at the entity's position plus half its eye height from a fixed eye height of player.posY + 1.2, and getRotationFromPosition converts the delta into the yaw and pitch that SingleAura writes into the UpdateEvent. The 1.2 eye offset and the half-eye-height target point are hardcoded rather than derived from the player's actual eye height, so vertical aim is a fixed approximation - accurate for ground-level targets, slightly off for targets far above or below. doScaffoldRotations and getBowAngles are unrelated helpers that share the same atan2 math.

anticheat Countering Checks

The anticheat code that detects or counters the techniques this module uses. Full source, with the detection mechanism explained below each box.

anticheat FightHitbox (lag-compensated hitbox ray trace)

FightHitbox.java232 lines · Java
1
/*
2
 * This file is part of Hawk Anticheat.
3
 * Copyright (C) 2018 Hawk Development Team
4
 *
5
 * This program is free software: you can redistribute it and/or modify
6
 * it under the terms of the GNU General Public License as published by
7
 * the Free Software Foundation, either version 3 of the License, or
8
 * (at your option) any later version.
9
 *
10
 * This program is distributed in the hope that it will be useful,
11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
 * GNU General Public License for more details.
14
 *
15
 * You should have received a copy of the GNU General Public License
16
 * along with this program.  If not, see <https://www.gnu.org/licenses/>.
17
 */
18
19
package me.islandscout.hawk.check.combat;
20
21
import me.islandscout.hawk.HawkPlayer;
22
import me.islandscout.hawk.check.Cancelless;
23
import me.islandscout.hawk.check.CustomCheck;
24
import me.islandscout.hawk.event.Event;
25
import me.islandscout.hawk.event.InteractEntityEvent;
26
import me.islandscout.hawk.event.MoveEvent;
27
import me.islandscout.hawk.util.*;
28
import me.islandscout.hawk.wrap.block.WrappedBlock;
29
import me.islandscout.hawk.wrap.entity.WrappedEntity;
30
import org.bukkit.GameMode;
31
import org.bukkit.Location;
32
import org.bukkit.Material;
33
import org.bukkit.block.Block;
34
import org.bukkit.entity.Entity;
35
import org.bukkit.entity.Player;
36
import org.bukkit.util.BlockIterator;
37
import org.bukkit.util.Vector;
38
39
import java.util.HashMap;
40
import java.util.Map;
41
import java.util.UUID;
42
43
/**
44
 * The hit detection in Minecraft is mostly determined by the client,
45
 * thus servers are left to trust the client. (There are a few exceptions
46
 * for the unmodified Notchian server such as preventing hits exceeding 6
47
 * blocks from the target entity). This poses a problem for players and
48
 * server owners since players can modify the client to manipulate hit
49
 * detection and allow for cheating when in combat with other players.
50
 *
51
 * Hawk’s hitbox checking aims to detect cheating during player vs.
52
 * player combat by validating hits on the server. When the server
53
 * receives an interaction packet from the client, Hawk gets the client’s
54
 * last known position and next direction, and uses it to perform a ray
55
 * trace test on the victim’s hitbox. Before the ray-trace test begins,
56
 * though, Hawk must factor in latency by rewinding the victim’s hitbox
57
 * to an appropriate time based on the client’s ping latency. To
58
 * accomplish this, Hawk keeps a history of players’ positions and
59
 * timestamps in a table and it retrieves a position that best
60
 * approximates where it appeared to the client when the client attacked
61
 * it. Hawk then performs the ray-trace test to determine whether the
62
 * client landed the hit or not. Although the system may produce false
63
 * positives with clients on unstable connections, it is a fair tradeoff
64
 * between user experience and cheat prevention.
65
 *
66
 * There are other sources of error which will probably not be accounted
67
 * for in Hawk anytime soon. Other sources of error include:
68
 *   - The client receives entity relative moves in 1/32 block precision.
69
 *   - The client holds off one tick to smoothly animate other players
70
 *     on the screen in the case of slight network jitter. It will
71
 *     linearly interpolate from the last position to the latest
72
 *     position up to 3 ticks if it doesn't receive a relative move
73
 *     packet to update the player's position.
74
 *   - The client will predict the motion of some entities, such as
75
 *     arrows. If there is latency and something unexpected happens
76
 *     to the entity, the client may desynchronize from the server.
77
 *
78
 * In most cases, the client uses the current frame's yaw and pitch to
79
 * compute the direction vector for the attack hit-scan. Fortunately,
80
 * ticking and rendering is done in the same thread. Unfortunately, in
81
 * the tick stack, attacking is done before sending yaw/pitch updates
82
 * to the server, which means that we must wait until the next flying
83
 * packet to get the direction of the hit-scan.
84
 *
85
 * For realtime protection, it's best to use the EntityInteractDirection
86
 * check. It actively enforces directions, but it extrapolates the
87
 * yaw/pitch because of how the client hit-scanning works.
88
 */
89
public class FightHitbox extends CustomCheck implements Cancelless {
90
91
    private final double MAX_REACH;
92
    private final int PING_LIMIT;
93
    private final boolean CHECK_OTHER_ENTITIES;
94
    private final boolean LAG_COMPENSATION;
95
    private final boolean DEBUG_HITBOX;
96
    private final boolean DEBUG_RAY;
97
    private final boolean CHECK_OCCLUSION;
98
    private final boolean CHECK_BOX_INTERSECTION;
99
    private final double BOX_EPSILON = 0.005;
100
101
    private Map<UUID, InteractEntityEvent> lastInteractionMap;
102
103
    public FightHitbox() {
104
        super("fighthitbox", false, 5, 10000, 0.95, 5000, "%player% failed combat hitbox. %type% VL: %vl%", null);
105
        CHECK_BOX_INTERSECTION = (boolean) customSetting("checkBoxIntersection", "", true);
106
        CHECK_OCCLUSION = (boolean) customSetting("checkOccluding", "", false);
107
        MAX_REACH = (double) customSetting("maxReach", "", 3.1);
108
        CHECK_OTHER_ENTITIES = (boolean) customSetting("checkOtherEntities", "", false);
109
        LAG_COMPENSATION = (boolean) customSetting("lagCompensation", "", true);
110
        PING_LIMIT = (int) customSetting("pingLimit", "", -1);
111
        DEBUG_HITBOX = (boolean) customSetting("hitbox", "debug", false);
112
        DEBUG_RAY = (boolean) customSetting("ray", "debug", false);
113
        lastInteractionMap = new HashMap<>();
114
    }
115
116
    @Override
117
    protected void check(Event event) {
118
        if(event instanceof InteractEntityEvent)
119
            processHit((InteractEntityEvent)event);
120
        else if(event instanceof MoveEvent) {
121
            InteractEntityEvent interactEntityEvent = lastInteractionMap.get(event.getHawkPlayer().getUuid());
122
            if(interactEntityEvent != null) {
123
                MoveEvent move = (MoveEvent) event;
124
125
                float yaw;
126
                float pitch;
127
                //In 1.8, the yaw of the cursor is behind by one tick.
128
                if(event.getHawkPlayer().getClientVersion() == 8) {
129
                    yaw = event.getHawkPlayer().getYaw();
130
                } else {
131
                    yaw = move.getTo().getYaw();
132
                }
133
                pitch = move.getTo().getPitch();
134
135
                processDirection(interactEntityEvent, yaw, pitch);
136
            }
137
            lastInteractionMap.put(event.getHawkPlayer().getUuid(), null);
138
        }
139
    }
140
141
    private void processHit(InteractEntityEvent e) {
142
        lastInteractionMap.put(e.getHawkPlayer().getUuid(), e);
143
    }
144
145
    private void processDirection(InteractEntityEvent e, float yaw, float pitch) {
146
        Entity entity = e.getEntity();
147
        if (!(entity instanceof Player) && !CHECK_OTHER_ENTITIES)
148
            return;
149
        Player attacker = e.getPlayer();
150
        int ping = ServerUtils.getPing(attacker);
151
        if (ping > PING_LIMIT && PING_LIMIT != -1)
152
            return;
153
154
        HawkPlayer att = e.getHawkPlayer();
155
        Location attackerEyeLocation = att.getPosition().clone().add(new Vector(0, 1.62, 0)).toLocation(att.getWorld());
156
        Vector attackerDirection = MathPlus.getDirection(yaw, pitch);
157
158
        double maxReach = MAX_REACH;
159
        if (attacker.getGameMode() == GameMode.CREATIVE)
160
            maxReach += 1.9;
161
162
        Vector victimLocation;
163
        if (LAG_COMPENSATION)
164
            //No need to add 50ms; the move and attack are already chronologically so close together
165
            victimLocation = hawk.getLagCompensator().getHistoryLocation(ping, e.getEntity()).toVector();
166
        else
167
            victimLocation = e.getEntity().getLocation().toVector();
168
169
        Vector eyePos;
170
        if(e.getHawkPlayer().isInVehicle()) {
171
            eyePos = hawk.getLagCompensator().getHistoryLocation(ping, e.getPlayer()).toVector();
172
            eyePos.setY(eyePos.getY() + e.getPlayer().getEyeHeight());
173
        }
174
        else {
175
            eyePos = new Vector(attackerEyeLocation.getX(), attacker.isSneaking() ? attackerEyeLocation.getY() - 0.08 : attackerEyeLocation.getY(), attackerEyeLocation.getZ());
176
        }
177
        Vector direction = new Vector(attackerDirection.getX(), attackerDirection.getY(), attackerDirection.getZ());
178
        Ray attackerRay = new Ray(eyePos, direction);
179
180
        AABB victimAABB;
181
        victimAABB = WrappedEntity.getWrappedEntity(entity).getHitbox(victimLocation);
182
        victimAABB.expand(BOX_EPSILON, BOX_EPSILON, BOX_EPSILON);
183
184
        Vector intersectVec3d = victimAABB.intersectsRay(attackerRay, 0, Float.MAX_VALUE);
185
186
        if (DEBUG_HITBOX) {
187
            victimAABB.highlight(hawk, attacker.getWorld(), 0.29);
188
        }
189
190
        if (DEBUG_RAY) {
191
            attackerRay.highlight(hawk, attacker.getWorld(), maxReach, 0.1);
192
        }
193
194
        if (intersectVec3d != null) {
195
            Location intersect = new Location(attacker.getWorld(), intersectVec3d.getX(), intersectVec3d.getY(), intersectVec3d.getZ());
196
            double interDistance = intersect.distance(attackerEyeLocation);
197
            if (interDistance > maxReach) {
198
                punish(att, 1, true, e, new Placeholder("type", "Reach: " + MathPlus.round(interDistance, 2) + "m"));
199
                return;
200
            }
201
            if (CHECK_OCCLUSION && interDistance > 1D) {
202
                BlockIterator iter = new BlockIterator(attacker.getWorld(), eyePos, attackerDirection, 0, (int) interDistance + 1);
203
                while (iter.hasNext()) {
204
                    Block bukkitBlock = iter.next();
205
206
                    if (bukkitBlock.getType() == Material.AIR || bukkitBlock.isLiquid())
207
                        continue;
208
209
                    WrappedBlock b = WrappedBlock.getWrappedBlock(bukkitBlock, att.getClientVersion());
210
                    Vector intersection = b.getHitBox().intersectsRay(new Ray(attackerEyeLocation.toVector(), attackerDirection), 0, Float.MAX_VALUE);
211
                    if (intersection != null) {
212
                        if (intersection.distance(eyePos) < interDistance) {
213
                            punish(att, 1, true, e, new Placeholder("type", "Interacted through " + b.getBukkitBlock().getType()));
214
                            return;
215
                        }
216
                    }
217
                }
218
219
            }
220
        } else if (CHECK_BOX_INTERSECTION) {
221
            punish(att, 1, true, e, new Placeholder("type", "Did not hit hitbox."));
222
            return;
223
        }
224
225
        reward(att); //reward player
226
    }
227
228
    @Override
229
    public void removeData(Player p) {
230
        lastInteractionMap.remove(p.getUniqueId());
231
    }
232
}

How it counteracts this module

Hawk re-derives hit validity on the server instead of trusting the client. FightHitbox defers each InteractEntityEvent until the next MoveEvent so the ray uses the yaw/pitch the client actually attacked with (for 1.8 clients the stored yaw is used because the cursor is a tick behind), then casts from the attacker's eye location (position + 1.62, minus 0.08 when sneaking) along that direction against the victim's hitbox, rewound through hawk's lag compensator by the attacker's ping and expanded by a 0.005 epsilon. maxReach defaults to 3.1 (5.0 in creative). An intersection farther than maxReach punishes with 'Reach: Xm'; no intersection at all punishes 'Did not hit hitbox.' when checkBoxIntersection is on (default); and with checkOccluding enabled, a block hit before the victim punishes 'Interacted through <block>'.\n\nAgainst Memeware this fires on every hit: the Range setting defaults to 6 and goes to 8, so the 3.1 cap is exceeded by several blocks and each attack reports its measured reach. The module also never calls canEntityBeSeen, so with checkOccluding on, the C02 through a wall is exposed as a block intersection that arrives before the victim. What the check cannot see is a legitimate sub-3.1 attack: the 0.005 epsilon and lag-compensated victim position absorb the small interpolation error, but a 6-block hit is nowhere near that tolerance, so lowering Range to 3 or below is the only way past it.

anticheat AimbotHeuristic (rotation pattern around clicks)

AimbotHeuristic.java164 lines · Java
1
/*
2
 * This file is part of Hawk Anticheat.
3
 * Copyright (C) 2018 Hawk Development Team
4
 *
5
 * This program is free software: you can redistribute it and/or modify
6
 * it under the terms of the GNU General Public License as published by
7
 * the Free Software Foundation, either version 3 of the License, or
8
 * (at your option) any later version.
9
 *
10
 * This program is distributed in the hope that it will be useful,
11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
 * GNU General Public License for more details.
14
 *
15
 * You should have received a copy of the GNU General Public License
16
 * along with this program.  If not, see <https://www.gnu.org/licenses/>.
17
 */
18
19
package me.islandscout.hawk.check.movement.look;
20
21
import me.islandscout.hawk.HawkPlayer;
22
import me.islandscout.hawk.check.CustomCheck;
23
import me.islandscout.hawk.check.Cancelless;
24
import me.islandscout.hawk.event.*;
25
import me.islandscout.hawk.util.Debug;
26
import me.islandscout.hawk.util.MathPlus;
27
import org.bukkit.entity.Player;
28
import org.bukkit.util.Vector;
29
30
import java.util.*;
31
32
/**
33
 * AimbotHeuristic exploits flaws in aim-bot cheats by
34
 * analyzing mouse movement patterns during interaction. Although
35
 * easily bypassed, it catches a significant number of cheaters.
36
 * Caution is advised since this check may false flag during
37
 * certain circumstances. This check should only be used as a
38
 * hint that the player might be cheating.
39
 */
40
public class AimbotHeuristic extends CustomCheck implements Cancelless {
41
42
    private final Map<UUID, List<Vector>> mouseMoves;
43
    private final Map<UUID, List<Long>> clickTimes;
44
45
    private static final int MOVES_PER_SAMPLE = 4; //must be greater than 0
46
    private final int MOVES_AFTER_HIT;
47
    private final boolean DEBUG;
48
49
    public AimbotHeuristic() {
50
        super("aimbotheuristic", false, -1, 5, 0.99, 5000, "&7%player% failed aimbot (heuristic), VL %vl%", null);
51
        mouseMoves = new HashMap<>();
52
        clickTimes = new HashMap<>();
53
54
        MOVES_AFTER_HIT = MOVES_PER_SAMPLE - MOVES_PER_SAMPLE / 2;
55
56
        DEBUG = (boolean) customSetting("debug", "", false);
57
    }
58
59
    public void check(Event e) {
60
        if (e instanceof MoveEvent) {
61
            processMove((MoveEvent) e);
62
        } else if (e instanceof InteractEntityEvent || e instanceof InteractWorldEvent) {
63
            processClick(e);
64
        }
65
    }
66
67
    private void processMove(MoveEvent e) {
68
        Player p = e.getPlayer();
69
        HawkPlayer pp = e.getHawkPlayer();
70
        UUID uuid = p.getUniqueId();
71
72
        List<Vector> lastMoves = mouseMoves.getOrDefault(uuid, new ArrayList<>());
73
        Vector mouseMove = new Vector(e.getTo().getYaw() - e.getFrom().getYaw(), e.getTo().getPitch() - e.getFrom().getPitch(), 0);
74
75
        lastMoves.add(mouseMove);
76
        //make size 1 bigger so that we can get the move before
77
        //the first move that we check
78
        if(lastMoves.size() > MOVES_PER_SAMPLE + 1) {
79
            lastMoves.remove(0);
80
        }
81
        mouseMoves.put(uuid, lastMoves);
82
83
        if(clickedXMovesBefore(MOVES_AFTER_HIT, pp)) {
84
            double minSpeed = Double.MAX_VALUE;
85
            double maxSpeed = 0D;
86
            double maxAngle = 0D;
87
            for(int i = 1; i < lastMoves.size(); i++) {
88
                Vector lastMouseMove = lastMoves.get(i - 1);
89
                Vector currMouseMove = lastMoves.get(i);
90
                double speed = currMouseMove.length();
91
                double lastSpeed = lastMouseMove.length();
92
                double angle = (lastSpeed != 0 && lastSpeed != 0) ? MathPlus.angle(lastMouseMove, currMouseMove) : 0D;
93
                if(Double.isNaN(angle))
94
                    angle = 0D;
95
                maxSpeed = Math.max(speed, maxSpeed);
96
                minSpeed = Math.min(speed, minSpeed);
97
                maxAngle = Math.max(angle, maxAngle);
98
99
                //stutter
100
                if(maxSpeed - minSpeed > 4 && minSpeed < 0.01 && maxAngle < 0.1 && lastSpeed > 1) { //this lastSpeed check eliminates a false positive
101
                    if(DEBUG) {
102
                        p.sendMessage("AimbotHeuristic: A");
103
                    }
104
                    punishEm(pp, e);
105
                }
106
                //twitching or zig zags
107
                else if(speed > 20 && lastSpeed > 20 && angle > 2.86) {
108
                    if(DEBUG) {
109
                        p.sendMessage("AimbotHeuristic: B");
110
                    }
111
                    punishEm(pp, e);
112
                }
113
                //jump discontinuity
114
                else if(speed - lastSpeed < -30 && angle > 0.8) {
115
                    if(DEBUG) {
116
                        p.sendMessage("AimbotHeuristic: C");
117
                    }
118
                    punishEm(pp, e);
119
                }
120
                else {
121
                    reward(pp);
122
                }
123
            }
124
        }
125
    }
126
127
    private boolean clickedXMovesBefore(long x, HawkPlayer pp) {
128
        List<Long> clickTimess = clickTimes.getOrDefault(pp.getUuid(), new ArrayList<>());
129
        long time = pp.getCurrentTick() - x;
130
        for(int i = 0; i < clickTimess.size(); i++) {
131
            if(time == clickTimess.get(i)) {
132
                clickTimess.remove(i);
133
                return true;
134
            }
135
        }
136
        return false;
137
    }
138
139
    private void processClick(Event e) {
140
        UUID uuid = e.getPlayer().getUniqueId();
141
        List<Long> clickTimess = clickTimes.getOrDefault(uuid, new ArrayList<>());
142
        long currTick = e.getHawkPlayer().getCurrentTick();
143
        if(!clickTimess.contains(currTick))
144
            clickTimess.add(e.getHawkPlayer().getCurrentTick());
145
146
        //memory leak fail-safe, if necessary?
147
        for(int i = clickTimess.size() - 1; i >= 0; i--) {
148
            if(currTick - clickTimess.get(i) > MOVES_PER_SAMPLE + 1)
149
                clickTimess.remove(i);
150
        }
151
152
        clickTimes.put(uuid, clickTimess);
153
    }
154
155
    private void punishEm(HawkPlayer pp, MoveEvent e) {
156
        punish(pp, false, e);
157
    }
158
159
    @Override
160
    public void removeData(Player p) {
161
        mouseMoves.remove(p.getUniqueId());
162
        clickTimes.remove(p.getUniqueId());
163
    }
164
}

How it counteracts this module

A cancelless hint check that analyzes the mouse-move samples around each interaction. It keeps the last MOVES_PER_SAMPLE + 1 = 5 per-tick yaw/pitch deltas, records the tick of every click, and two moves after a hit (MOVES_AFTER_HIT = 2) scores the sample window for three signatures: a stutter (maxSpeed - minSpeed > 4 with minSpeed < 0.01 and maxAngle < 0.1, requiring lastSpeed > 1 to cut false positives), a twitch or zig-zag (two consecutive moves each with speed above 20 and an angle between them over 2.86), and a jump discontinuity (speed dropping by more than 30 in one move while the angle exceeds 0.8).\n\nMemeware's per-tick snap-to-target produces exactly these patterns whenever the target or player moves: the rotation goes from a large correction (the snap) to a near-zero hold, so a click landing in that window scores a high maxSpeed next to a minSpeed under 0.01 with a small angle - the stutter branch. When a target strafes, each new snap is a large single-tick move followed by stillness, which the twitch branch reads as a sudden jump in speed. The check stays quiet only against a perfectly stationary target, where the deltas are all near zero and no window ever contains a big snap; the module's own javadoc concedes it is 'easily bypassed' and best used as a flag hint.

anticheat AttackFrequency (per-second attack caps)

AttackFrequency.java114 lines · Java
1
/*
2
 * This program is free software: you can redistribute it and/or modify
3
 *   it under the terms of the GNU General Public License as published by
4
 *   the Free Software Foundation, either version 3 of the License, or
5
 *   (at your option) any later version.
6
 *
7
 *   This program is distributed in the hope that it will be useful,
8
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
9
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
10
 *   GNU General Public License for more details.
11
 *
12
 *   You should have received a copy of the GNU General Public License
13
 *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
14
 */
15
package fr.neatmonster.nocheatplus.checks.net;
16
17
import org.bukkit.entity.Player;
18
19
import fr.neatmonster.nocheatplus.actions.ParameterName;
20
import fr.neatmonster.nocheatplus.checks.Check;
21
import fr.neatmonster.nocheatplus.checks.CheckType;
22
import fr.neatmonster.nocheatplus.checks.ViolationData;
23
import fr.neatmonster.nocheatplus.players.IPlayerData;
24
import fr.neatmonster.nocheatplus.utilities.TickTask;
25
26
public class AttackFrequency extends Check {
27
28
    public AttackFrequency() {
29
        super(CheckType.NET_ATTACKFREQUENCY);
30
    }
31
32
    /**
33
     * Checks a player
34
     * (Checks hasBypass on violation only)
35
     * 
36
     * @param player
37
     * @param time milliseconds
38
     * @param data
39
     * @param cc
40
     * @param pData
41
     * @return true if successful
42
     */
43
    public boolean check(final Player player, final long time, final NetData data, final NetConfig cc, final IPlayerData pData) {
44
        // Update frequency.
45
        data.attackFrequencySeconds.add(time, 1f);
46
        double maxVL = 0.0;
47
        float maxLimit = 0f;
48
        String tags = null;
49
        // TODO: option to normalize the vl / stats to per second? 
50
        // HALF
51
        float sum = data.attackFrequencySeconds.bucketScore(0); // HALF
52
        float limit = cc.attackFrequencyLimitSecondsHalf;
53
        if (sum - limit > maxVL) {
54
            maxVL = sum - limit;
55
            maxLimit = limit;
56
            tags = "sec_half";
57
        }
58
        // ONE (update sum).
59
        sum += data.attackFrequencySeconds.bucketScore(1);
60
        limit = cc.attackFrequencyLimitSecondsOne;
61
        if (sum - limit > maxVL) {
62
            maxVL = sum - limit;
63
            maxLimit = limit;
64
            tags = "sec_one";
65
        }
66
        // TWO (update sum).
67
        sum += data.attackFrequencySeconds.sliceScore(2, 4, 1f);
68
        limit = cc.attackFrequencyLimitSecondsTwo;
69
        if (sum - limit > maxVL) {
70
            maxVL = sum - limit;
71
            maxLimit = limit;
72
            tags = "sec_two";
73
        }
74
        // FOUR (update sum).
75
        sum += data.attackFrequencySeconds.sliceScore(4, 8, 1f);
76
        limit = cc.attackFrequencyLimitSecondsFour;
77
        if (sum - limit > maxVL) {
78
            maxVL = sum - limit;
79
            maxLimit = limit;
80
            tags = "sec_four";
81
        }
82
        // EIGHT (update sum).
83
        sum += data.attackFrequencySeconds.sliceScore(8, 16, 1f);
84
        limit = cc.attackFrequencyLimitSecondsEight;
85
        if (sum - limit > maxVL) {
86
            maxVL = sum - limit;
87
            maxLimit = limit;
88
            tags = "sec_eight";
89
        }
90
91
        if (pData.isDebugActive(CheckType.NET_ATTACKFREQUENCY)) {
92
            player.sendMessage("AttackFrequency: " + data.attackFrequencySeconds.toLine());
93
        }
94
95
        boolean cancel = false;
96
        if (maxVL > 0.0) {
97
            // Trigger a violation.
98
            final ViolationData vd = new ViolationData(this, player, maxVL, 1.0, cc.attackFrequencyActions);
99
            if (pData.isDebugActive(type) || vd.needsParameters()) {
100
                vd.setParameter(ParameterName.PACKETS, Integer.toString((int) sum));
101
                vd.setParameter(ParameterName.LIMIT, Integer.toString((int) maxLimit));
102
                vd.setParameter(ParameterName.TAGS, tags);
103
            }
104
            cancel = executeActions(vd).willCancel();
105
            // Feed Improbable.
106
            if (cc.attackFrequencyImprobableWeight > 0.0f) {
107
            	TickTask.requestImprobableUpdate(player.getUniqueId(), cc.attackFrequencyImprobableWeight);
108
            }
109
        }
110
111
        return cancel;
112
    }
113
114
}

How it counteracts this module

NCP counts only real attacks: the ProtocolLib UseEntityAdapter interprets every USE_ENTITY packet, resolves the action (legacy reflection or ProtocolLib enum wrappers), and feeds only ATTACK actions into data.attackFrequencySeconds, an ActionFrequency with 16 buckets of 500ms covering 8 seconds. Each check call compares five running sums against the config limits - the newest 500ms bucket against 8, the 1s sum against 15, the 2s sum against 30, the 4s sum against 60 and the 8s sum against 95 - and triggers a violation the moment any sum exceeds its limit, feeding TickTask's Improbable system with weight 3.0 and applying the default actions (cancel vl>10, kick at vl>200).\n\nMemeware sends exactly one C02 per blockhit cycle at Click Speed (12-20 CPS), so the module's upper range is what this check counters: a sustained 16 CPS trips the 1s cap (16 vs 15) and the 2s cap (32 vs 30), and 17+ CPS trips the 500ms cap (8-9 vs 8). The default 12 CPS sits comfortably under all five caps, and the 8s window means short bursts average out, so a user who keeps Click Speed at or below 15 sees no violations - the module's max of 20 is the exposure.

anticheat KillAura (direction / noswing / reach / speed)

KillAura.java114 lines · Java
1
package me.vrekt.arc.check.combat;
2
3
import me.vrekt.arc.Arc;
4
import me.vrekt.arc.check.Check;
5
import me.vrekt.arc.check.CheckType;
6
import me.vrekt.arc.data.combat.FightData;
7
import me.vrekt.arc.utilties.LocationHelper;
8
import org.bukkit.ChatColor;
9
import org.bukkit.entity.Entity;
10
import org.bukkit.entity.Player;
11
import org.bukkit.util.Vector;
12
13
public class KillAura extends Check {
14
15
    private double maxAngle, maxReach;
16
    private int maxSwingTime, maxAttacks, maxAttackPackets;
17
18
    public KillAura() {
19
        super(CheckType.KILLAURA);
20
21
        maxAngle = Arc.getCheckManager().getValueDouble(CheckType.KILLAURA, "max-direction-angle");
22
        maxSwingTime = Arc.getCheckManager().getValueInt(CheckType.KILLAURA, "max-swing-time");
23
        maxReach = Arc.getCheckManager().getValueDouble(CheckType.KILLAURA, "max-reach");
24
        maxAttacks = Arc.getCheckManager().getValueInt(CheckType.KILLAURA, "max-attacks");
25
        maxAttackPackets = Arc.getCheckManager().getValueInt(CheckType.KILLAURA, "max-attack-packets");
26
27
    }
28
29
    public boolean check(FightData data, Player player) {
30
        result.reset();
31
32
        Entity last = data.getLastAttackedEntity();
33
        Entity entity = data.getAttackedEntity();
34
35
        // Calculate angle stuff.
36
        Vector playerLocation = player.getLocation().toVector();
37
        Vector entityLocation = entity.getLocation().toVector();
38
        double angle = entityLocation.subtract(playerLocation).angle(player.getLocation().getDirection());
39
40
        if (last != null && !entity.equals(last)) {
41
            // check the angle between the two entities
42
            Vector lastLocation = last.getLocation().toVector();
43
            double angleToLast = lastLocation.subtract(playerLocation).angle(player.getLocation().getDirection());
44
            double angleDifference = Math.abs(angleToLast - angle);
45
            double distanceDifference = LocationHelper.distance(last.getLocation(), entity.getLocation());
46
            if (angleDifference > maxAngle && distanceDifference <= maxReach) {
47
                getCheck().setCheckName("Kill Aura " + ChatColor.GRAY + "(Multi)");
48
                result.set(checkViolation(player, "Angle difference greater than allowed. a=" + angleDifference + " e=" + maxAngle));
49
            }
50
        }
51
52
        // check yaw difference.
53
        if (angle > maxAngle) {
54
            getCheck().setCheckName("Kill Aura " + ChatColor.GRAY + "(Direction)");
55
            result.set(checkViolation(player, "Angle distance greater than allowed. a=" + angle + " e=" + maxAngle));
56
        }
57
58
        // check swing time.
59
        long time = System.currentTimeMillis() - data.getLastArmSwing();
60
        if (time > maxSwingTime) {
61
            getCheck().setCheckName("Kill Aura " + ChatColor.GRAY + "(NoSwing)");
62
            result.set(checkViolation(player, "Player did not swing their arm in time."));
63
        }
64
65
        // distance to entity excluding knockback.
66
        double distance = LocationHelper.distance(player.getLocation(), entity.getLocation().subtract(entity.getVelocity()));
67
        // check for reach
68
        if (distance > maxReach) {
69
            getCheck().setCheckName("Kill Aura " + ChatColor.GRAY + "(Reach)");
70
            result.set(checkViolation(player, "Entity is out of players range. d=" + distance + " e=" + maxReach));
71
        }
72
73
        // check max attacks
74
        if (data.getLastAttackCheck() == 0) {
75
            data.setLastAttackCheck(System.currentTimeMillis());
76
        }
77
        long lastAttack = System.currentTimeMillis() - data.getLastAttackCheck();
78
        if (lastAttack >= 1000) {
79
            // check if we exceeded the max attacks in the last second.
80
            int totalAttacks = data.getTotalAttacks();
81
            if (totalAttacks > maxAttacks) {
82
                getCheck().setCheckName("Kill Aura " + ChatColor.GRAY + "(Speed)");
83
                result.set(checkViolation(player, "Attacking too fast. a=" + totalAttacks + " e=" + maxAttacks));
84
            }
85
            // reset data for next check.
86
            data.setTotalAttacks(0);
87
            data.setLastAttackCheck(System.currentTimeMillis());
88
        }
89
90
        getCheck().setCheckName("KillAura");
91
        return result.failed();
92
    }
93
94
    public boolean checkFrequency(FightData data, Player player) {
95
        if (data.getLastAttackCheck() == 0) {
96
            data.setLastAttackCheck(System.currentTimeMillis());
97
            return false;
98
        }
99
100
        long time = System.currentTimeMillis() - data.getLastAttackCheck();
101
        if (time >= 1000) {
102
            data.setLastAttackCheck(System.currentTimeMillis());
103
            int totalPackets = data.getAttackPackets();
104
            if (totalPackets > maxAttackPackets) {
105
                data.setAttackPackets(0);
106
                getCheck().setCheckName("Kill Aura " + ChatColor.GRAY + "(Speed)");
107
                return checkViolation(player, "Attacking too fast a=" + totalPackets + " e=" + maxAttackPackets);
108
            }
109
        }
110
111
        return false;
112
    }
113
114
}

How it counteracts this module

Arc v2's composite killaura check runs from FightListener.onFight on the EntityDamageByEntityEvent at HIGHEST priority and scores five sub-conditions with defaults from config.yml: max-direction-angle 1.2 radians, max-swing-time 80ms, max-reach 4.2 blocks, max-attacks 16 per second and max-attack-packets 20 per second. The Multi branch compares the angle between two consecutively attacked entities (angleDifference > 1.2 while both are within reach), Direction measures the angle from the player's look vector to the entity, NoSwing fires when more than 80ms pass without an arm swing, Reach measures the distance to the entity's location minus its current velocity (knockback exclusion), and Speed counts attacks and attack packets per second, resetting each second.\n\nAgainst Memeware the reach sub-check is the hard counter: the module's 6-8 block Range dwarfs the 4.2 cap and the distance is measured to the entity position minus velocity, so knockback does not mask it. The Speed sub-check catches the top of the CPS range (20 CPS exceeds both 16 attacks/s and 20 packets/s), while the default 12 CPS passes. Direction passes because the module snaps both yaw and pitch onto the target, and NoSwing passes because swingItem() precedes every C02 - so on a default-config server only the reach component fires, and it fires on every hit.

← Back to Analysis Hub