Rise 6.1.30 Mimic module 2 files, 105 lines

Rise 6.1.30 Mimic: Full Source Analysis

Mimic copies another player's combat behavior onto the local player.

com/alan/clients/module/impl/combat/Mimic.java · GitHub source ↗

Published 2026-08-13 · Updated 2026-08-13

Packets This Module Uses

Analysis

Overview

Mimic copies another player's combat behavior onto the local player. Two BooleanValue-with-Mode toggles define the two halves: Clicker (ClickerMimic) records the target's arm-swing cadence from the S0B animation stream and replays it as real clicks, and Rotations (RotationsMimic) mirrors the target's look direction with eased, jittered setAngles steps. Both halves activate only while the attack key is held. The wire footprint is the vanilla click path: each replayed click runs clickMouse, which swings (C0A) and attacks (C02), and the mirrored rotations land in the next C03 look fields.

ClickerMimic

A VERY_LOW PacketReceiveEvent watches S0B arm animations for entities other than the player, groups the tick deltas between swings per player name, and prints the recorded interval. On PreUpdateEvent with the attack key held, the mode pops the head of the recorded list, rejects intervals of zero ticks or 450ms and above (the while loop keeps re-rolling until an interval between 1 and 8 ticks is found), then waits half that interval and calls mc.clickMouse() with leftClickCounter set to 1. Replaying at half the recorded interval doubles the click rate; holding sneak clears the recording. The recorded stream is tick-quantized because it is read from ticksExisted, so even a human cadence is stored as whole-tick gaps.

RotationsMimic

With a target within 6 blocks and the attack key held, the mode mirrors the target's look: yaw becomes target.rotationYaw minus 180 and pitch becomes the negated target pitch, then both are eased through 150ms LINEAR Animation objects. A RotationUtil.move pass computes an overshoot toward the real target and adds it with a divisor of 1.05 when the yaw difference exceeds 90 degrees, otherwise 1.5, so the mirrored direction leans toward the target. The offset relative to the player's current look is jittered by plus or minus 5% of itself, and Render2D applies it through setAngles scaled by the mouse-sensitivity cube (the same 0.15 factor the mouse path uses), so the resulting rotation stream is eased, quantized and never a snap.

Wire presence

ClickerMimic's clickMouse produces the standard 1.8 attack order: swingItem first, then the C02 attack, so every replay emits one C0A and one C02. RotationsMimic never sends packets of its own; setAngles writes the view angles and the next C03PacketPlayer carries them as the server-visible look. The two halves compose into a player whose swing cadence and look motion statistically resemble the recorded victim's, which is the module's whole point: the stream looks like a different human's combat.

source Mimic.java (mode shell)

Mimic.java16 lines · JavaOriginal ↗
1
package com.alan.clients.module.impl.combat;
2
3
import com.alan.clients.module.Module;
4
import com.alan.clients.module.api.Category;
5
import com.alan.clients.module.api.ModuleInfo;
6
import com.alan.clients.module.impl.combat.mimic.ClickerMimic;
7
import com.alan.clients.module.impl.combat.mimic.RotationsMimic;
8
import com.alan.clients.value.impl.BooleanValue;
9
10
@ModuleInfo(aliases = {"Mimic"}, description = "", category = Category.COMBAT)
11
public final class Mimic extends Module {
12
13
    private BooleanValue rotations = new BooleanValue("Rotations", this, true, new RotationsMimic("Rotations", this));
14
    private BooleanValue clicker = new BooleanValue("Clicker", this, true, new ClickerMimic("Clicker", this));
15
16
}

What this file does

The shell is 16 lines and defines the two halves as BooleanValue-with-Mode toggles, the second Rise 6.x module shape after ModeValue shells: Rotations (default on) carries RotationsMimic, Clicker (default on) carries ClickerMimic. The module itself has no event handlers; enabling it activates whichever sub-modes are toggled. The aliases list is just the name, and the description string is empty in this snapshot, so the behavior documented here comes from the mode classes.

source ClickerMimic.java (click half)

ClickerMimic.java89 lines · JavaOriginal ↗
1
package com.alan.clients.module.impl.combat.mimic;
2
3
import com.alan.clients.event.Listener;
4
import com.alan.clients.event.Priorities;
5
import com.alan.clients.event.annotations.EventLink;
6
import com.alan.clients.event.impl.motion.PreUpdateEvent;
7
import com.alan.clients.event.impl.packet.PacketReceiveEvent;
8
import com.alan.clients.module.impl.combat.Mimic;
9
import com.alan.clients.util.chat.ChatUtil;
10
import com.alan.clients.value.Mode;
11
import net.minecraft.network.Packet;
12
import net.minecraft.network.play.server.S0BPacketAnimation;
13
import net.minecraft.util.Tuple;
14
15
import java.util.ArrayList;
16
import java.util.HashMap;
17
import java.util.Optional;
18
19
public class ClickerMimic extends Mode<Mimic> {
20
21
    public ClickerMimic(String name, Mimic parent) {
22
        super(name, parent);
23
    }
24
25
    private long next;
26
    private HashMap<String, Tuple<ArrayList<Integer>, Integer>> clicks = new HashMap<>();
27
28
    @EventLink(value = Priorities.VERY_LOW)
29
    public final Listener<PacketReceiveEvent> onReceive = event -> {
30
        Packet<?> packet = event.getPacket();
31
32
        if (packet instanceof S0BPacketAnimation) {
33
            S0BPacketAnimation animation = ((S0BPacketAnimation) packet);
34
35
            int id = animation.getEntityID();
36
            if (id == mc.thePlayer.getEntityId()) return;
37
38
            String name = mc.theWorld.getEntityByID(id).getCommandSenderName();
39
            int tick = mc.thePlayer.ticksExisted;
40
41
            if (!clicks.containsKey(name)) {
42
                clicks.put(name, new Tuple<>(new ArrayList<>(), tick));
43
            }
44
45
            Tuple<ArrayList<Integer>, Integer> data = clicks.get(name);
46
47
            ChatUtil.display("Recorded " + (tick - data.getSecond()) + " von " + name);
48
            data.getFirst().add(tick - data.getSecond());
49
            data.setSecond(tick);
50
        }
51
    };
52
53
    @EventLink(value = Priorities.VERY_LOW)
54
    public final Listener<PreUpdateEvent> onPreUpdate = event -> {
55
        if (!mc.gameSettings.keyBindAttack.isKeyDown()) return;
56
57
        if (mc.gameSettings.keyBindSneak.isKeyDown()) clicks = new HashMap<>();
58
59
        if (System.currentTimeMillis() > next) {
60
            long next = 0;
61
62
            while (next == 0 || next >= 9 * 50) {
63
                if (next != 0) ChatUtil.display("Running again prev " + next);
64
                Optional<String> first = clicks.keySet().stream().findFirst();
65
66
                if (!first.isPresent()) {
67
                    ChatUtil.display("Empty");
68
                    return;
69
                }
70
                Tuple<ArrayList<Integer>, Integer> data = clicks.get(first.get());
71
72
                if (data.getFirst().isEmpty()) {
73
                    clicks.remove(first.get());
74
                    return;
75
                }
76
77
                next = data.getFirst().get(0) * 50;
78
                data.getFirst().remove(0);
79
80
                ChatUtil.display("Running " + first.get() + " " + next);
81
            }
82
83
            this.next = System.currentTimeMillis() + next / 2L;
84
85
            mc.clickMouse();
86
            mc.leftClickCounter = 1;
87
        }
88
    };
89
}

What this file does

The click half, 89 lines. The recording listener converts S0B animations into per-player tick-delta lists keyed by entity display name, and the replay listener consumes them on PreUpdateEvent: it rejects intervals of zero ticks and 450ms and above, waits half the chosen interval, and replays through mc.clickMouse() with leftClickCounter pinned to 1. The ChatUtil.display calls are debug output that ships in the snapshot. This file is the wire-relevant half because every replay is a full vanilla click; the rotation half is analyzed in the sections.

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 FightSpeed (doubled replay rate)

FightSpeed.java90 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.EntityInteractionCheck;
23
import me.islandscout.hawk.event.InteractAction;
24
import me.islandscout.hawk.event.InteractEntityEvent;
25
import me.islandscout.hawk.util.MathPlus;
26
import me.islandscout.hawk.util.Placeholder;
27
import org.bukkit.entity.Player;
28
29
import java.util.*;
30
31
public class FightSpeed extends EntityInteractionCheck {
32
33
    //This check is very similar to the FightSpeedConsistency check, however I will
34
    //not be merging these, because their SAMPLES variable may vary
35
    //based on configuration. For instance, FightSpeedConsistency relies on samples
36
    //of 5, yet this check relies on samples of 10.
37
38
    private final Map<UUID, Long> lastClickTime; //in client ticks
39
    private final Map<UUID, List<Long>> deltaTimes;
40
    private static final double RECORD_SENSITIVITY = 4; //don't log click if it took longer than these ticks
41
    private static int SAMPLES;
42
    private final double MAX_CPS;
43
44
    public FightSpeed() {
45
        super("fightspeed", "%player% failed attack speed. CPS: %cps%, VL: %vl%");
46
        lastClickTime = new HashMap<>();
47
        deltaTimes = new HashMap<>();
48
        SAMPLES = (int)customSetting("sampleSize", "", 10);
49
        MAX_CPS = (double)customSetting("maxCps", "", 16D);
50
    }
51
52
    @Override
53
    protected void check(InteractEntityEvent e) {
54
        if (e.getInteractAction() == InteractAction.INTERACT)
55
            return;
56
        UUID uuid = e.getPlayer().getUniqueId();
57
        HawkPlayer pp = e.getHawkPlayer();
58
        if (lastClickTime.containsKey(uuid)) {
59
            List<Long> deltaTs = deltaTimes.getOrDefault(uuid, new ArrayList<>());
60
            long deltaT = (pp.getCurrentTick() - lastClickTime.get(uuid));
61
            if (deltaT <= RECORD_SENSITIVITY) {
62
                deltaTs.add(deltaT);
63
                if (deltaTs.size() >= SAMPLES) {
64
                    double avgCps = 0;
65
                    for (double entry : deltaTs) {
66
                        avgCps += entry;
67
                    }
68
                    double divisor = (avgCps / SAMPLES / 20);
69
                    avgCps = 1 / divisor;
70
                    //if someone manages to get an Infinity, they're dumb af
71
                    if (avgCps > MAX_CPS) {
72
                        punish(pp, 1, true, e, new Placeholder("cps", (Double.isInfinite(avgCps) ? avgCps : MathPlus.round(avgCps, 2) + "")));
73
                    } else {
74
                        reward(pp);
75
                    }
76
                    deltaTs.remove(0);
77
                }
78
                deltaTimes.put(uuid, deltaTs);
79
            }
80
        }
81
        lastClickTime.put(uuid, pp.getCurrentTick());
82
    }
83
84
    @Override
85
    public void removeData(Player p) {
86
        UUID uuid = p.getUniqueId();
87
        lastClickTime.remove(uuid);
88
        deltaTimes.remove(uuid);
89
    }
90
}

How it counteracts this module

FightSpeed caps the C02 rate at 16 CPS: it logs tick deltas of at most 4 ticks between consecutive non-INTERACT InteractEntityEvents, and every 10-sample window whose mean spacing implies more than 16 CPS punishes. The replay loop makes the rate the direct signal: intervals are replayed at half their recorded length, so a recorded 2-tick (100ms) cadence replays at 50ms, a flat 20 CPS, and a recorded 1-tick cadence replays at 25ms, 40 CPS.

The recorded cadence itself is tick-quantized, so the replay is a step function of 50ms multiples, exactly the low-jitter profile the check scores: deltas of one or two ticks read 20 or more CPS and every window punishes. The honest boundary: a recorded victim who clicks slowly produces intervals that replay under the cap, and the module's rate then sits where a human's would.

anticheat FightSpeedConsistency (recorded cadence regularity)

FightSpeedConsistency.java120 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.EntityInteractionCheck;
24
import me.islandscout.hawk.event.*;
25
import me.islandscout.hawk.util.MathPlus;
26
import org.bukkit.entity.Player;
27
28
import java.util.*;
29
30
public class FightSpeedConsistency extends EntityInteractionCheck implements Cancelless {
31
32
    //This check is very similar to the FightSpeed check, however I will
33
    //not be merging these, because their SAMPLES variable may vary
34
    //based on configuration. For instance, FightSpeed relies on samples
35
    //of 10, yet this check relies on samples of 5.
36
37
    private final int SAMPLES;
38
    private final int SAMPLE_SIZE;
39
    private final double STDEV_THRESHOLD;
40
    private final double MIN_CPS;
41
    private final int RECORD_THRESHOLD; //don't log click if it took longer than these ticks
42
43
    private final Map<UUID, List<Double>> pSamples;
44
    private final Map<UUID, Long> lastClickTick;
45
    private final Map<UUID, List<Long>> deltaTimes;
46
47
    public FightSpeedConsistency() {
48
        super("fightspeedconsistency", false, -1, 3, 0.99, 5000, "%player% failed click consistency. Autoclicker? VL: %vl%", null);
49
        MIN_CPS = (double)customSetting("checkAboveCPS", "", 10D);
50
        SAMPLES = (int)customSetting("samples", "", 5);
51
        SAMPLE_SIZE = (int)customSetting("sampleSize", "", 20);
52
        STDEV_THRESHOLD = (double)customSetting("stdevThreshold", "", 0.05D);
53
        RECORD_THRESHOLD = (int)(20 * (1 / MIN_CPS) + 1);
54
        pSamples = new HashMap<>();
55
        lastClickTick = new HashMap<>();
56
        deltaTimes = new HashMap<>();
57
    }
58
59
    @Override
60
    protected void check(InteractEntityEvent e) {
61
        if (e.getInteractAction() == InteractAction.INTERACT)
62
            return;
63
        UUID uuid = e.getPlayer().getUniqueId();
64
        HawkPlayer pp = e.getHawkPlayer();
65
        if (lastClickTick.containsKey(uuid)) {
66
            List<Long> deltaTs = deltaTimes.getOrDefault(uuid, new ArrayList<>());
67
            long deltaT = (pp.getCurrentTick() - lastClickTick.get(uuid));
68
69
            //log click if player clicks faster than this
70
            if (deltaT <= RECORD_THRESHOLD) {
71
                deltaTs.add(deltaT);
72
73
                //begin computing avg cps
74
                if (deltaTs.size() >= SAMPLE_SIZE) {
75
                    double avgCps = 0;
76
                    for (double entry : deltaTs) {
77
                        avgCps += entry;
78
                    }
79
                    double divisor = (avgCps / SAMPLE_SIZE / 20);
80
                    avgCps = 1 / divisor;
81
82
                    List<Double> sampless = pSamples.getOrDefault(uuid, new ArrayList<>());
83
                    sampless.add(avgCps);
84
85
                    //Debug.broadcastMessage(avgCps + "");
86
87
                    //Begin computing standard deviation and judge player.
88
                    //Only if above min cps and enough samples.
89
                    //Acts like a narrow barrier between the two limits to prevent false flags.
90
                    //Explanation: When clicks are barely meeting speed requirements, a narrow
91
                    //range of CPSs will be processed, thus setting off false flags.
92
                    if(avgCps > MIN_CPS && sampless.size() >= SAMPLES) {
93
                        //Debug.broadcastMessage(ChatColor.YELLOW + "" + MathPlus.stdev(sampless));
94
                        if(MathPlus.stdev(sampless) < STDEV_THRESHOLD) {
95
                            punish(pp, false, e);
96
                        }
97
                        else {
98
                            reward(pp);
99
                        }
100
                    }
101
102
                    if(sampless.size() >= SAMPLES) {
103
                        sampless.remove(0);
104
                    }
105
                    pSamples.put(uuid, sampless);
106
                    deltaTs.remove(0);
107
                }
108
                deltaTimes.put(uuid, deltaTs);
109
            }
110
        }
111
        lastClickTick.put(uuid, pp.getCurrentTick());
112
    }
113
114
    @Override
115
    public void removeData(Player p) {
116
        pSamples.remove(p.getUniqueId());
117
        lastClickTick.remove(p.getUniqueId());
118
        deltaTimes.remove(p.getUniqueId());
119
    }
120
}

How it counteracts this module

FightSpeedConsistency punishes cadence regularity: 20-click window means above MIN_CPS 10 with a standard deviation under 0.05 across five windows. A periodic replay source produces window means that barely move, so the stdev test fires whenever the mean clears the gate.

The mimic is a mixed case. A victim with a regular cadence (another autoclicker, or a human clicking steadily) stores near-constant tick gaps, and the doubled replay keeps the window means constant, so the check fires at any mean above 10 CPS. A genuinely irregular human cadence stores varied gaps and replays them at scale, so the window means wander above 0.05 and the check stays quiet: the mimic reproduces the victim's own irregularity, which is the honest gap this entry documents.

anticheat KillAura (attack windows and swing freshness)

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 KillAura windows: attackPackets (C02 ATTACK per second, cap 20, cancels the overflow packet) and totalAttacks (every C02 per second, cap 16, flags Kill Aura (Speed)), both fed by PacketListener. The swing half is lastArmSwing stamped from the C0A stream with max-swing-time 80ms.

Every replay is a full clickMouse, so the C0A ledger stays fresh and the NoSwing half passes, while the attack windows see the doubled rate: a 20 CPS replay sits exactly at the attackPackets cap and a burstier replay crosses it and gets packets cancelled. Below roughly 16 sustained CPS the windows hold, which is the boundary to state rather than overclaim.

anticheat NoSwing (swing-always gap)

NoSwing.java65 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.fight;
16
17
import org.bukkit.entity.Player;
18
19
import fr.neatmonster.nocheatplus.checks.Check;
20
import fr.neatmonster.nocheatplus.checks.CheckType;
21
22
/**
23
 * We require that the player moves their arm between attacks, this is basically what gets checked here.
24
 */
25
public class NoSwing extends Check {
26
27
    /**
28
     * Instantiates a new no swing check.
29
     */
30
    public NoSwing() {
31
        super(CheckType.FIGHT_NOSWING);
32
    }
33
34
    /**
35
     * Checks a player.
36
     * 
37
     * @param player
38
     *            the player
39
     * @return true, if successful
40
     */
41
    public boolean check(final Player player, final FightData data, final FightConfig cc) {
42
        boolean cancel = false;
43
44
        if (data.exemptArmSwing) {
45
            data.exemptArmSwing = false;
46
        }
47
        // Did they swing his arm before?
48
        else if (++data.noSwingCount <= 1) {
49
            // Yes, reward them with reduction of their violation level.
50
            data.noSwingVL *= 0.9D;
51
        } 
52
        else {
53
            data.noSwingCount = 0;
54
            // No, increase their violation level.
55
            data.noSwingVL += 1D;
56
57
            // Execute whatever actions are associated with this check and the violation level and find out if we should
58
            // cancel the event.
59
            cancel = executeActions(player, data.noSwingVL, 1D, cc.noSwingActions).willCancel();
60
        }
61
62
        return cancel;
63
    } 
64
65
}

How it counteracts this module

NCP's fight NoSwing requires a swing between attacks: FightListener counts noSwingCount up per C02 and down per PlayerAnimationEvent, and the check decays the violation level for a single swingless attack, then adds a level and executes actions (default cancel at level 2) on the second consecutive one.

Because the replay path is clickMouse, every replay swings first, so the ledger never accumulates and this check is an honest gap for Mimic, exactly as it is for AutoClicker. It belongs in the set as the negative result that separates swing-always clickers from swingless killaura, and it frames why the rate checks are the real countering layer for the click half of this module.

← Back to Analysis Hub