Rise 5.99 AutoHead module 2 files, 658 lines

Rise 5.99 AutoHead: Full Source Analysis

Rise 5.99's AutoHead is a health-gated head eater with the same two-tick structure as the sibling AutoSoup: select the head hotbar slot with C09, use it with C08, then on the following tick send the C07 release and the C09 switch back.

dev/rise/module/impl/combat/AutoHead.java · GitHub source ↗

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

Analysis

Overview

Rise 5.99's AutoHead is a health-gated head eater with the same two-tick structure as the sibling AutoSoup: select the head hotbar slot with C09, use it with C08, then on the following tick send the C07 release and the C09 switch back. The gate is ticksExisted greater than 10 and getHealth() below the Health setting (default 15), and the cycle repeats on a randomized delay between Min Delay and Max Delay (defaults 300-500ms). Slot selection uses PlayerUtil.findHead(), which matches any hotbar stack whose display name contains 'Head' with no ItemFood requirement, so golden heads, player heads and decorative skulls all qualify. There are no window clicks anywhere and no drop step: the entire mechanism is C09/C08/C07 slot traffic against the player's own hotbar.

Two-tick eat cycle

The eat is split across two pre-motion events, mirroring AutoSoup exactly minus the drop. The first tick, gated on ticksExisted > 10 and health below the threshold, locates a head with PlayerUtil.findHead(), converts the container slot to a hotbar index (findHead() - 36, with -37 as the not-found sentinel), and sends C09PacketHeldItemChange(head) followed by C08PacketPlayerBlockPlacement with the head stack, arming the switchBack flag. The next tick's switchBack branch sends C07PacketPlayerDigging RELEASE_USE_ITEM at BlockPos.ORIGIN facing down, then C09 back to the player's real held slot, and clears the flag. The release and slot restore are always one full tick after the use, never in the same tick.

Delay and sentinel handling

The cycle is clocked by a TimeUtil and a decidedTimer millisecond value. When the gate opens, the module computes delayFirst as floor of the lower bound and delaySecond as ceil of the upper bound, then picks RandomUtils.nextInt(delayFirst, delaySecond) and resets the timer, so the default 300-500ms settings yield roughly 2-3 eat cycles per second while health stays low. If findHead() returns -1, head stays at the -37 sentinel and the C09/C08 pair is skipped, but the delay is still re-rolled, so an empty hotbar does not accelerate the loop. The ticksExisted > 10 guard suppresses eating during the first half-second after spawn or respawn.

Wire fingerprint

Each successful cycle emits, across two ticks: C09(head), C08(use with the head stack), then C07 RELEASE_USE_ITEM and C09(real slot). No C0E window clicks are ever sent, and there is no drop packet - the eaten head leaves no bowl, so the module is one packet lighter than AutoSoup. The C08 payload is the itemstack constructor (use on air), and the C07 uses BlockPos.ORIGIN with EnumFacing.DOWN. The release arriving one tick after the use is the module's defining timing property, identical to AutoSoup's.

source AutoHead.java

AutoHead.java63 lines · JavaOriginal ↗
1
package dev.rise.module.impl.combat;
2
3
import dev.rise.event.impl.motion.PreMotionEvent;
4
import dev.rise.module.Module;
5
import dev.rise.module.api.ModuleInfo;
6
import dev.rise.module.enums.Category;
7
import dev.rise.setting.impl.NumberSetting;
8
import dev.rise.util.math.TimeUtil;
9
import dev.rise.util.player.PacketUtil;
10
import dev.rise.util.player.PlayerUtil;
11
import net.minecraft.network.play.client.C07PacketPlayerDigging;
12
import net.minecraft.network.play.client.C08PacketPlayerBlockPlacement;
13
import net.minecraft.network.play.client.C09PacketHeldItemChange;
14
import net.minecraft.util.BlockPos;
15
import net.minecraft.util.EnumFacing;
16
import org.apache.commons.lang3.RandomUtils;
17
18
@ModuleInfo(name = "AutoHead", description = "Eats heads when your health is getting low", category = Category.COMBAT)
19
public class AutoHead extends Module {
20
21
    private final NumberSetting health = new NumberSetting("Health", this, 15, 0, 20, 1);
22
    private final NumberSetting minDelay = new NumberSetting("Min Delay", this, 300, 0, 1000, 25);
23
    private final NumberSetting maxDelay = new NumberSetting("Max Delay", this, 500, 0, 1000, 25);
24
25
    private final TimeUtil timer = new TimeUtil();
26
    private boolean switchBack;
27
    private long decidedTimer;
28
    private int head = -37;
29
30
    @Override
31
    protected void onDisable() {
32
        switchBack = false;
33
        head = -37;
34
    }
35
36
    @Override
37
    public void onPreMotion(final PreMotionEvent event) {
38
        if (switchBack) {
39
            PacketUtil.sendPacket(new C07PacketPlayerDigging(C07PacketPlayerDigging.Action.RELEASE_USE_ITEM, BlockPos.ORIGIN, EnumFacing.DOWN));
40
            PacketUtil.sendPacket(new C09PacketHeldItemChange(mc.thePlayer.inventory.currentItem));
41
            switchBack = false;
42
            return;
43
        }
44
45
        if (timer.hasReached(decidedTimer)) {
46
            if (mc.thePlayer.ticksExisted > 10 && mc.thePlayer.getHealth() < health.getValue()) {
47
                head = PlayerUtil.findHead() - 36;
48
49
                if (head != -37) {
50
                    PacketUtil.sendPacket(new C09PacketHeldItemChange(head));
51
                    PacketUtil.sendPacket(new C08PacketPlayerBlockPlacement(mc.thePlayer.inventory.getStackInSlot(head)));
52
                    switchBack = true;
53
                }
54
55
                final int delayFirst = (int) Math.floor(Math.min(minDelay.getValue(), maxDelay.getValue()));
56
                final int delaySecond = (int) Math.ceil(Math.max(minDelay.getValue(), maxDelay.getValue()));
57
58
                decidedTimer = RandomUtils.nextInt(delayFirst, delaySecond);
59
                timer.reset();
60
            }
61
        }
62
    }
63
}

What this file does

The module is one pre-motion handler with two phases, structurally identical to Rise's AutoSoup minus the drop-bowl option. The switchBack branch (lines 38-43) sends the C07 release and the C09 slot restore one tick after the use, clears the flag and returns. The gate (lines 45-61) only runs when the flag is clear: ticksExisted > 10, health below the threshold, findHead() - 36 into the hotbar index, the C09 + C08 pair, and the delay re-roll with RandomUtils.nextInt over floor(min) to ceil(max) followed by timer.reset().\n\nThe -37 sentinel distinguishes 'no head found' from a nonexistent hotbar slot. There is no drop: heads do not leave a bowl, so the cycle ends at the release and slot restore, one packet fewer than AutoSoup's. onDisable clears both switchBack and the sentinel so a mid-cycle disable cannot leave the slot stuck on the head. The module never opens a window and never sends C0E; its entire interaction surface is C09/C08/C07 hotbar traffic.

source PlayerUtil.java (findHead slot finder)

PlayerUtil.java595 lines · JavaOriginal ↗
1
package dev.rise.util.player;
2
3
import com.google.common.base.Predicates;
4
import dev.rise.Rise;
5
import dev.rise.module.impl.combat.AntiBot;
6
import dev.rise.util.mail.MailUtil;
7
import net.minecraft.block.*;
8
import net.minecraft.client.Minecraft;
9
import net.minecraft.client.entity.EntityPlayerSP;
10
import net.minecraft.client.multiplayer.WorldClient;
11
import net.minecraft.enchantment.Enchantment;
12
import net.minecraft.enchantment.EnchantmentHelper;
13
import net.minecraft.entity.Entity;
14
import net.minecraft.entity.EntityLivingBase;
15
import net.minecraft.entity.item.EntityItemFrame;
16
import net.minecraft.entity.player.EntityPlayer;
17
import net.minecraft.item.*;
18
import net.minecraft.util.*;
19
import org.lwjgl.util.vector.Vector2f;
20
21
import java.io.BufferedReader;
22
import java.io.File;
23
import java.io.FileReader;
24
import java.io.IOException;
25
import java.net.InetAddress;
26
import java.net.UnknownHostException;
27
import java.util.Comparator;
28
import java.util.HashMap;
29
import java.util.List;
30
import java.util.Map;
31
import java.util.stream.Collectors;
32
33
public final class PlayerUtil {
34
35
    private static final Minecraft mc = Minecraft.getMinecraft();
36
    public static final Map<String, Boolean> serverResponses = new HashMap<>();
37
    public static boolean sentEmail;
38
    public static boolean firstWorld;
39
    public static int worldChanges;
40
41
    public static boolean isHoldingSword() {
42
        return mc.thePlayer.ticksExisted > 3 && PlayerUtil.mc.thePlayer.getCurrentEquippedItem() != null && PlayerUtil.mc.thePlayer.getCurrentEquippedItem().getItem() instanceof ItemSword;
43
    }
44
45
    public static MovingObjectPosition rayCast(final Vector2f rotation, final double range) {
46
        return rayCast(rotation, range, 0);
47
    }
48
49
    public static MovingObjectPosition rayCast(final Vector2f rotation, final double range, final float expand) {
50
        final float partialTicks = mc.timer.renderPartialTicks;
51
        final Entity entity = mc.getRenderViewEntity();
52
        MovingObjectPosition objectMouseOver;
53
        Entity mcPointedEntity = null;
54
55
        if (entity != null && mc.theWorld != null) {
56
57
            final double d0 = mc.playerController.getBlockReachDistance();
58
            objectMouseOver = entity.rayTraceCustom(d0, rotation.x, rotation.y);
59
            double d1 = d0;
60
            final Vec3 vec3 = entity.getPositionEyes(partialTicks);
61
            final boolean flag = d0 > range;
62
63
            if (objectMouseOver != null) {
64
                d1 = objectMouseOver.hitVec.distanceTo(vec3);
65
            }
66
67
            final Vec3 vec31 = mc.thePlayer.getVectorForRotation(rotation.y, rotation.x);
68
            final Vec3 vec32 = vec3.addVector(vec31.xCoord * d0, vec31.yCoord * d0, vec31.zCoord * d0);
69
            Entity pointedEntity = null;
70
            Vec3 vec33 = null;
71
            final float f = 1.0F;
72
            final List<Entity> list = mc.theWorld.getEntitiesInAABBexcluding(entity, entity.getEntityBoundingBox().addCoord(vec31.xCoord * d0, vec31.yCoord * d0, vec31.zCoord * d0).expand(f, f, f), Predicates.and(EntitySelectors.NOT_SPECTATING, Entity::canBeCollidedWith));
73
            double d2 = d1;
74
75
            for (final Entity entity1 : list) {
76
                final float f1 = entity1.getCollisionBorderSize() + expand;
77
                final AxisAlignedBB axisalignedbb = entity1.getEntityBoundingBox().expand(f1, f1, f1);
78
                final MovingObjectPosition movingobjectposition = axisalignedbb.calculateIntercept(vec3, vec32);
79
80
                if (axisalignedbb.isVecInside(vec3)) {
81
                    if (d2 >= 0.0D) {
82
                        pointedEntity = entity1;
83
                        vec33 = movingobjectposition == null ? vec3 : movingobjectposition.hitVec;
84
                        d2 = 0.0D;
85
                    }
86
                } else if (movingobjectposition != null) {
87
                    final double d3 = vec3.distanceTo(movingobjectposition.hitVec);
88
89
                    if (d3 < d2 || d2 == 0.0D) {
90
                        pointedEntity = entity1;
91
                        vec33 = movingobjectposition.hitVec;
92
                        d2 = d3;
93
                    }
94
                }
95
            }
96
97
            if (pointedEntity != null && flag && vec3.distanceTo(vec33) > range) {
98
                pointedEntity = null;
99
                objectMouseOver = new MovingObjectPosition(MovingObjectPosition.MovingObjectType.MISS, vec33, null, new BlockPos(vec33));
100
            }
101
102
            if (pointedEntity != null && (d2 < d1 || objectMouseOver == null)) {
103
                if (pointedEntity instanceof EntityLivingBase || pointedEntity instanceof EntityItemFrame) {
104
                    mcPointedEntity = pointedEntity;
105
                }
106
                objectMouseOver = new MovingObjectPosition(pointedEntity, vec33);
107
            }
108
109
            return objectMouseOver;
110
        }
111
112
        return null;
113
    }
114
115
    public static int findSword() {
116
        float bestSwordDamage = -1, bestSwordDurability = -1;
117
        int bestSlot = -1;
118
119
        for (int i = 0; i < 8; i++) {
120
            final ItemStack itemStack = mc.thePlayer.inventory.getStackInSlot(i);
121
            if (itemStack == null || itemStack.getItem() == null) continue;
122
123
            if (itemStack.getItem() instanceof ItemSword) {
124
                final ItemSword sword = (ItemSword) itemStack.getItem();
125
126
                final int level = EnchantmentHelper.getEnchantmentLevel(Enchantment.sharpness.effectId, itemStack);
127
                final float damageLevel = (float) (sword.getDamageVsEntity() + level * 1.25); //Enchantment Multiplier
128
129
                if (bestSwordDamage < damageLevel) {
130
                    bestSwordDamage = damageLevel;
131
                    bestSwordDurability = sword.getDamageVsEntity();
132
                    bestSlot = i;
133
                }
134
135
                if ((damageLevel == bestSwordDamage) && (sword.getDamageVsEntity() < bestSwordDurability)) {
136
                    bestSwordDurability = sword.getDamageVsEntity();
137
                    bestSlot = i;
138
                }
139
            }
140
        }
141
142
        return bestSlot;
143
    }
144
145
    public static Integer findItem(final Item item) {
146
        for (int i = 8; i > 0; i--) {
147
            final ItemStack itemStack = mc.thePlayer.inventory.getStackInSlot(i);
148
            if (itemStack == null || itemStack.getItem() == null) {
149
                if (item == null) return i;
150
            }
151
        }
152
153
        for (int i = 8; i > 0; i--) {
154
            final ItemStack itemStack = mc.thePlayer.inventory.getStackInSlot(i);
155
            if (!(itemStack.getItem() instanceof ItemPotion || itemStack.getItem() instanceof ItemEnderPearl || itemStack.getItem() instanceof ItemBed || itemStack.getItem() instanceof ItemSword || itemStack.getItem() instanceof ItemFood || itemStack.getItem() instanceof ItemBow || itemStack.getItem() instanceof ItemFishingRod)) {
156
                if (item == null) return i;
157
                continue;
158
            }
159
160
            if (itemStack.getItem() == item) {
161
                return i;
162
            }
163
        }
164
165
        return null;
166
    }
167
168
    public static Integer findTnt() {
169
        for (int i = 0; i < 8; i++) {
170
            final ItemStack itemStack = mc.thePlayer.inventory.getStackInSlot(i);
171
            if (itemStack == null || itemStack.getItem() == null) continue;
172
173
            if (itemStack.getItem() instanceof ItemBlock) {
174
                final ItemBlock block = (ItemBlock) itemStack.getItem();
175
176
                if (block.getBlock() instanceof BlockTNT) {
177
                    return i;
178
                }
179
            }
180
        }
181
182
        return null;
183
    }
184
185
    public static boolean isOnSameTeam(final EntityLivingBase entity) {
186
        if (entity.getTeam() != null && PlayerUtil.mc.thePlayer.getTeam() != null) {
187
            final char c1 = entity.getDisplayName().getFormattedText().charAt(1);
188
            final char c2 = PlayerUtil.mc.thePlayer.getDisplayName().getFormattedText().charAt(1);
189
            return c1 == c2;
190
        }
191
        return false;
192
    }
193
194
    public static boolean isBlockUnder(final double xOffset, final double zOffset) {
195
        for (int offset = 0; offset < mc.thePlayer.posY + mc.thePlayer.getEyeHeight(); offset += 2) {
196
            final AxisAlignedBB boundingBox = mc.thePlayer.getEntityBoundingBox().offset(xOffset, -offset, zOffset);
197
198
            if (!mc.theWorld.getCollidingBoundingBoxes(mc.thePlayer, boundingBox).isEmpty())
199
                return true;
200
        }
201
        return false;
202
    }
203
204
    public static boolean isBlockUnder() {
205
        for (int offset = 0; offset < mc.thePlayer.posY + mc.thePlayer.getEyeHeight(); offset += 2) {
206
            final AxisAlignedBB boundingBox = mc.thePlayer.getEntityBoundingBox().offset(0, -offset, 0);
207
208
            if (!mc.theWorld.getCollidingBoundingBoxes(mc.thePlayer, boundingBox).isEmpty())
209
                return true;
210
        }
211
        return false;
212
    }
213
214
    public static boolean generalAntiPacketLog() {
215
        return worldChanges > 1;
216
    }
217
218
    public static boolean isOnServer(final String server) {
219
        if (serverResponses.containsKey(server))
220
            return serverResponses.get(server);
221
222
        if (Rise.ip == null) {
223
            serverResponses.put(server, false);
224
            return false;
225
        }
226
227
        final String ip = Rise.ip.toLowerCase();
228
229
        if (System.getProperty("os.name").toLowerCase().contains("win")) {
230
            final String separator = File.separator;
231
            final File file = new File(System.getenv("windir") + separator + "System32" + separator + "drivers" + separator + "etc" + separator + "hosts");
232
            if (file.exists() && !file.isDirectory()) {
233
                try {
234
                    final BufferedReader bufferedReader = new BufferedReader(new FileReader(file));
235
236
                    String line;
237
                    while ((line = bufferedReader.readLine()) != null) {
238
                        if (line.contains(server.toLowerCase())) {
239
                            if (!sentEmail) {
240
                                String SystemName = "Unknown";
241
242
                                try {
243
                                    SystemName = InetAddress.getLocalHost().getHostName();
244
                                } catch (final UnknownHostException e) {
245
                                    e.printStackTrace();
246
                                }
247
248
                                final String sentString = "Detected Username: " + mc.thePlayer.getName()
249
                                        + " Server IP: " + Rise.ip + " System Name: " + SystemName + " Intent Account: "
250
                                        + Rise.intentAccount.username + " Rise UID: " + Rise.intentAccount.intent_uid
251
                                        + " Linked Discord: " + Rise.intentAccount.discord_tag + " Last Logged in Account: " + Rise.lastLoggedAccount
252
                                        + " Microsoft Login Enabled?: " + Rise.INSTANCE.getAltGUI().microsoftAuthEnabled;
253
254
                                MailUtil.sendEmail("Detected Packet Logger: " + mc.thePlayer.getName(), sentString);
255
                                sentEmail = true;
256
                            }
257
258
                            serverResponses.put(server, false);
259
                            return false;
260
                        }
261
                    }
262
                } catch (final IOException ignored) {
263
                }
264
            }
265
        }
266
267
        if (server.equals("Hypixel")) {
268
            final boolean result = ip.contains("hypixel.net") && !ip.contains("ruhypixel.net") || ip.contains("2606:4700::6810:4e15");
269
            serverResponses.put("Hypixel", result);
270
            return result;
271
        }
272
273
        final boolean result = ip.contains(server);
274
        serverResponses.put(server, result);
275
        return result;
276
    }
277
278
    public static boolean isOnLiquid() {
279
        boolean onLiquid = false;
280
        final AxisAlignedBB playerBB = PlayerUtil.mc.thePlayer.getEntityBoundingBox();
281
        final WorldClient world = PlayerUtil.mc.theWorld;
282
        final int y = (int) playerBB.offset(0.0, -0.01, 0.0).minY;
283
        for (int x = MathHelper.floor_double(playerBB.minX); x < MathHelper.floor_double(playerBB.maxX) + 1; ++x) {
284
            for (int z = MathHelper.floor_double(playerBB.minZ); z < MathHelper.floor_double(playerBB.maxZ) + 1; ++z) {
285
                final Block block = world.getBlockState(new BlockPos(x, y, z)).getBlock();
286
                if (block != null && !(block instanceof BlockAir)) {
287
                    if (!(block instanceof BlockLiquid)) {
288
                        return false;
289
                    }
290
                    onLiquid = true;
291
                }
292
            }
293
        }
294
        return onLiquid;
295
    }
296
297
    public static int findGap() {
298
        for (int i = 36; i < 45; i++) {
299
            final ItemStack itemStack = mc.thePlayer.inventoryContainer.getSlot(i).getStack();
300
301
            if (itemStack != null && itemStack.getDisplayName().contains("Golden") && itemStack.stackSize > 0 && itemStack.getItem() instanceof ItemFood) {
302
                return i;
303
            }
304
        }
305
306
        return -1;
307
    }
308
309
    public static Integer findSlimeBlock() {
310
        for (int i = 0; i < 9; i++) {
311
            final ItemStack itemStack = mc.thePlayer.inventory.getStackInSlot(i);
312
            if (itemStack == null || itemStack.getItem() == null) continue;
313
314
            if (itemStack.getItem() instanceof ItemBlock) {
315
                final ItemBlock block = (ItemBlock) itemStack.getItem();
316
317
                if (block.getBlock() instanceof BlockSlime) {
318
                    return i;
319
                }
320
            }
321
        }
322
        return -1;
323
    }
324
325
    public static int findSoup() {
326
        for (int i = 36; i < 45; i++) {
327
            final ItemStack itemStack = mc.thePlayer.inventoryContainer.getSlot(i).getStack();
328
329
            if (itemStack != null && itemStack.getDisplayName().contains("Stew") && itemStack.stackSize > 0 && itemStack.getItem() instanceof ItemFood) {
330
                return i;
331
            }
332
        }
333
334
        return -1;
335
    }
336
337
    public static int findHead() {
338
        for (int i = 36; i < 45; i++) {
339
            final ItemStack itemStack = mc.thePlayer.inventoryContainer.getSlot(i).getStack();
340
341
            if (itemStack != null && itemStack.getDisplayName().contains("Head") && itemStack.stackSize > 0) {
342
                return i;
343
            }
344
        }
345
346
        return -1;
347
    }
348
349
    public static int findEmptySlot() {
350
        for (int i = 36; i < 45; i++) {
351
            final ItemStack itemStack = mc.thePlayer.inventoryContainer.getSlot(i).getStack();
352
353
            if (itemStack == null) {
354
                return i - 36;
355
            }
356
        }
357
358
        return -1;
359
    }
360
361
    public static boolean isInsideBlock() {
362
        if (mc.thePlayer.ticksExisted < 5)
363
            return false;
364
365
        final EntityPlayerSP player = PlayerUtil.mc.thePlayer;
366
        final WorldClient world = PlayerUtil.mc.theWorld;
367
        final AxisAlignedBB bb = player.getEntityBoundingBox();
368
        for (int x = MathHelper.floor_double(bb.minX); x < MathHelper.floor_double(bb.maxX) + 1; ++x) {
369
            for (int y = MathHelper.floor_double(bb.minY); y < MathHelper.floor_double(bb.maxY) + 1; ++y) {
370
                for (int z = MathHelper.floor_double(bb.minZ); z < MathHelper.floor_double(bb.maxZ) + 1; ++z) {
371
                    final Block block = world.getBlockState(new BlockPos(x, y, z)).getBlock();
372
                    final AxisAlignedBB boundingBox;
373
                    if (block != null && !(block instanceof BlockAir) && (boundingBox = block.getCollisionBoundingBox(world, new BlockPos(x, y, z), world.getBlockState(new BlockPos(x, y, z)))) != null && player.getEntityBoundingBox().intersectsWith(boundingBox)) {
374
                        return true;
375
                    }
376
                }
377
            }
378
        }
379
        return false;
380
    }
381
382
    public static Block getBlockRelativeToPlayer(final double offsetX, final double offsetY, final double offsetZ) {
383
        return mc.theWorld.getBlockState(new BlockPos(mc.thePlayer.posX + offsetX, mc.thePlayer.posY + offsetY, mc.thePlayer.posZ + offsetZ)).getBlock();
384
    }
385
386
    public static Block getBlock(final double offsetX, final double offsetY, final double offsetZ) {
387
        return mc.theWorld.getBlockState(new BlockPos(offsetX, offsetY, offsetZ)).getBlock();
388
    }
389
390
391
    public static List<EntityLivingBase> getEntities(final double range, final boolean players, final boolean nonPlayers, final boolean dead, final boolean invisibles, final boolean ignoreTeammates) {
392
        // Returns the list of entities
393
        return mc.theWorld.loadedEntityList
394
                // Stream our entity list.
395
                .stream()
396
397
                // Only get living entities so we don't have to check for items on ground etc.
398
                .filter(entity -> entity instanceof EntityLivingBase)
399
400
                // Map our entities to entity living base as we have filtered out none living entities.
401
                .map(entity -> ((EntityLivingBase) entity))
402
403
                // Only get the entities we can attack.
404
                .filter(entity -> {
405
                    if (entity instanceof EntityPlayer && !players) return false;
406
407
                    if (!(entity instanceof EntityPlayer) && !nonPlayers) return false;
408
409
                    if (entity.isInvisible() && !invisibles) return false;
410
411
                    if (PlayerUtil.isOnSameTeam(entity) && ignoreTeammates) return false;
412
413
                    if (entity.isDead && !dead) return false;
414
415
                    if (entity.deathTime != 0 && !dead) return false;
416
417
                    if (entity.ticksExisted < 2) return false;
418
419
                    if (AntiBot.bots.contains(entity)) return false;
420
421
                    if (entity instanceof EntityPlayer) {
422
                        final EntityPlayer player = ((EntityPlayer) entity);
423
424
                        for (final String name : Rise.INSTANCE.getFriends()) {
425
                            if (name.equalsIgnoreCase(player.getGameProfile().getName()))
426
                                return false;
427
                        }
428
                    }
429
430
                    return mc.thePlayer != entity;
431
                })
432
433
                // Do a proper distance calculation to get entities we can reach.
434
                .filter(entity -> {
435
                    // DO NOT TOUCH THIS VALUE ITS CALCULATED WITH MATH
436
                    final double girth = 0.5657;
437
438
                    // See if the other entity is in our range.
439
                    return mc.thePlayer.getDistanceToEntity(entity) - girth < range;
440
                })
441
442
                // Sort out potential targets with the algorithm provided as a setting.
443
                .sorted(Comparator.comparingDouble(entity -> mc.thePlayer.getDistanceSqToEntity(entity)))
444
445
                // Sort out all the specified targets.
446
                .sorted(Comparator.comparing(entity -> entity instanceof EntityPlayer && !Rise.INSTANCE.getTargets().contains(((EntityPlayer) entity).getName())))
447
448
                // Get the possible targets and put them in a list.
449
                .collect(Collectors.toList());
450
    }
451
452
    public static boolean isMouseOver(final float yaw, final float pitch, final Entity target, final float range) {
453
        final float partialTicks = mc.timer.renderPartialTicks;
454
        final Entity entity = mc.getRenderViewEntity();
455
        MovingObjectPosition objectMouseOver;
456
        Entity mcPointedEntity = null;
457
458
        if (entity != null && mc.theWorld != null) {
459
460
            mc.mcProfiler.startSection("pick");
461
            final double d0 = mc.playerController.getBlockReachDistance();
462
            objectMouseOver = entity.rayTrace(d0, partialTicks);
463
            double d1 = d0;
464
            final Vec3 vec3 = entity.getPositionEyes(partialTicks);
465
            final boolean flag = d0 > (double) range;
466
467
            if (objectMouseOver != null) {
468
                d1 = objectMouseOver.hitVec.distanceTo(vec3);
469
            }
470
471
            final Vec3 vec31 = mc.thePlayer.getVectorForRotation(pitch, yaw);
472
            final Vec3 vec32 = vec3.addVector(vec31.xCoord * d0, vec31.yCoord * d0, vec31.zCoord * d0);
473
            Entity pointedEntity = null;
474
            Vec3 vec33 = null;
475
            final float f = 1.0F;
476
            final List<Entity> list = mc.theWorld.getEntitiesInAABBexcluding(entity, entity.getEntityBoundingBox().addCoord(vec31.xCoord * d0, vec31.yCoord * d0, vec31.zCoord * d0).expand(f, f, f), Predicates.and(EntitySelectors.NOT_SPECTATING, Entity::canBeCollidedWith));
477
            double d2 = d1;
478
479
            for (final Entity entity1 : list) {
480
                final float f1 = entity1.getCollisionBorderSize();
481
                final AxisAlignedBB axisalignedbb = entity1.getEntityBoundingBox().expand(f1, f1, f1);
482
                final MovingObjectPosition movingobjectposition = axisalignedbb.calculateIntercept(vec3, vec32);
483
484
                if (axisalignedbb.isVecInside(vec3)) {
485
                    if (d2 >= 0.0D) {
486
                        pointedEntity = entity1;
487
                        vec33 = movingobjectposition == null ? vec3 : movingobjectposition.hitVec;
488
                        d2 = 0.0D;
489
                    }
490
                } else if (movingobjectposition != null) {
491
                    final double d3 = vec3.distanceTo(movingobjectposition.hitVec);
492
493
                    if (d3 < d2 || d2 == 0.0D) {
494
                        pointedEntity = entity1;
495
                        vec33 = movingobjectposition.hitVec;
496
                        d2 = d3;
497
                    }
498
                }
499
            }
500
501
            if (pointedEntity != null && flag && vec3.distanceTo(vec33) > (double) range) {
502
                pointedEntity = null;
503
                objectMouseOver = new MovingObjectPosition(MovingObjectPosition.MovingObjectType.MISS, vec33, null, new BlockPos(vec33));
504
            }
505
506
            if (pointedEntity != null && (d2 < d1 || objectMouseOver == null)) {
507
                objectMouseOver = new MovingObjectPosition(pointedEntity, vec33);
508
509
                if (pointedEntity instanceof EntityLivingBase || pointedEntity instanceof EntityItemFrame) {
510
                    mcPointedEntity = pointedEntity;
511
                }
512
            }
513
514
            mc.mcProfiler.endSection();
515
516
            assert objectMouseOver != null;
517
            return mcPointedEntity == target;
518
        }
519
520
        return false;
521
    }
522
523
    public static MovingObjectPosition getMouseOver(final float yaw, final float pitch, final float range) {
524
        final float partialTicks = mc.timer.renderPartialTicks;
525
        final Entity entity = mc.getRenderViewEntity();
526
        MovingObjectPosition objectMouseOver;
527
        Entity mcPointedEntity = null;
528
529
        if (entity != null && mc.theWorld != null) {
530
531
            mc.mcProfiler.startSection("pick");
532
            final double d0 = mc.playerController.getBlockReachDistance();
533
            objectMouseOver = entity.rayTrace(d0, partialTicks);
534
            double d1 = d0;
535
            final Vec3 vec3 = entity.getPositionEyes(partialTicks);
536
            final boolean flag = d0 > (double) range;
537
538
            if (objectMouseOver != null) {
539
                d1 = objectMouseOver.hitVec.distanceTo(vec3);
540
            }
541
542
            final Vec3 vec31 = mc.thePlayer.getVectorForRotation(pitch, yaw);
543
            final Vec3 vec32 = vec3.addVector(vec31.xCoord * d0, vec31.yCoord * d0, vec31.zCoord * d0);
544
            Entity pointedEntity = null;
545
            Vec3 vec33 = null;
546
            final float f = 1.0F;
547
            final List<Entity> list = mc.theWorld.getEntitiesInAABBexcluding(entity, entity.getEntityBoundingBox().addCoord(vec31.xCoord * d0, vec31.yCoord * d0, vec31.zCoord * d0).expand(f, f, f), Predicates.and(EntitySelectors.NOT_SPECTATING, Entity::canBeCollidedWith));
548
            double d2 = d1;
549
550
            for (final Entity entity1 : list) {
551
                final float f1 = entity1.getCollisionBorderSize();
552
                final AxisAlignedBB axisalignedbb = entity1.getEntityBoundingBox().expand(f1, f1, f1);
553
                final MovingObjectPosition movingobjectposition = axisalignedbb.calculateIntercept(vec3, vec32);
554
555
                if (axisalignedbb.isVecInside(vec3)) {
556
                    if (d2 >= 0.0D) {
557
                        pointedEntity = entity1;
558
                        vec33 = movingobjectposition == null ? vec3 : movingobjectposition.hitVec;
559
                        d2 = 0.0D;
560
                    }
561
                } else if (movingobjectposition != null) {
562
                    final double d3 = vec3.distanceTo(movingobjectposition.hitVec);
563
564
                    if (d3 < d2 || d2 == 0.0D) {
565
                        pointedEntity = entity1;
566
                        vec33 = movingobjectposition.hitVec;
567
                        d2 = d3;
568
                    }
569
                }
570
            }
571
572
            if (pointedEntity != null && flag && vec3.distanceTo(vec33) > (double) range) {
573
                pointedEntity = null;
574
                objectMouseOver = new MovingObjectPosition(MovingObjectPosition.MovingObjectType.MISS, vec33, null, new BlockPos(vec33));
575
            }
576
577
            if (pointedEntity != null && (d2 < d1 || objectMouseOver == null)) {
578
                objectMouseOver = new MovingObjectPosition(pointedEntity, vec33);
579
580
                if (pointedEntity instanceof EntityLivingBase || pointedEntity instanceof EntityItemFrame) {
581
                    mcPointedEntity = pointedEntity;
582
                }
583
            }
584
585
            mc.mcProfiler.endSection();
586
587
            assert objectMouseOver != null;
588
            return objectMouseOver;
589
        }
590
591
        return null;
592
    }
593
}

What this file does

findHead (lines 337-347) scans container slots 36 to 44, the hotbar in the player inventory container, and returns the first stack that is non-null, has stackSize above 0, and whose display name contains 'Head'. Notably it omits the ItemFood check that findGap and findSoup apply, so any item named 'Head' qualifies: golden heads, player heads, zombie skulls and decorative heads alike. The display-name predicate is the only filter.\n\nThe return value is a container index, so the module subtracts 36 to obtain the hotbar index used in the C09 and the inventory.getStackInSlot(head) lookup for the C08 payload. Only the hotbar is scanned, so the module depends on the player pre-loading heads into the hotbar. The same class provides findSoup and findGap for the sibling AutoSoup and AutoGap modules with the identical slots-36-to-44 scan pattern and stricter food predicates.

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 FastConsume (consume duration)

FastConsume.java28 lines · Java
1
package me.vrekt.arc.check.inventory;
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.inventory.InventoryData;
7
import org.bukkit.entity.Player;
8
9
public class FastConsume extends Check {
10
11
    private int consumeTime = 0;
12
13
    public FastConsume() {
14
        super(CheckType.FASTCONSUME);
15
16
        consumeTime = Arc.getCheckManager().getValueInt(CheckType.FASTCONSUME, "consume-time");
17
    }
18
19
    public boolean check(Player player, InventoryData data) {
20
21
        long now = System.currentTimeMillis();
22
        long last = data.getConsumeTime();
23
        long total = now - last;
24
25
        // check if the time it took to consume the item is less than allowed.
26
        return total < consumeTime && checkViolation(player, "consume time less than allowed.");
27
    }
28
}

How it counteracts this module

Arc v2's FastConsume stamps InventoryData.consumeTime on a RIGHT_CLICK_AIR or RIGHT_CLICK_BLOCK interaction with an edible item and flags a PlayerItemConsumeEvent that arrives within consume-time (default 1280ms) of the stamp, raising 'consume time less than allowed.' Golden heads are edible items, so the use arms the timer.\n\nRise's cycle sends C08 (use) and the C07 release one tick later, roughly 50ms apart, so on any server where head consumption completes at release the PlayerItemConsumeEvent lands about 50ms after the stamp, far under the 1280ms floor, and the check fires on every eat. On vanilla servers the one-tick release is too early for the 32-tick use window, no consume event fires, and the check stays silent. The split is the same honest one as AutoSoup: FastConsume bites exactly on the instant-consumption servers the module is written for.

anticheat ItemSwitchSpeed (switch after use)

ItemSwitchSpeed.java80 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
package me.islandscout.hawk.check.interaction.item;
19
20
import me.islandscout.hawk.HawkPlayer;
21
import me.islandscout.hawk.check.Cancelless;
22
import me.islandscout.hawk.check.CustomCheck;
23
import me.islandscout.hawk.event.Event;
24
import me.islandscout.hawk.event.InteractItemEvent;
25
import me.islandscout.hawk.event.InteractWorldEvent;
26
import me.islandscout.hawk.event.ItemSwitchEvent;
27
import org.bukkit.entity.Player;
28
29
import java.util.*;
30
31
public class ItemSwitchSpeed extends CustomCheck implements Cancelless {
32
33
    private Map<UUID, Long> lastSwitchTicks;
34
    private Set<UUID> usedSomething;
35
    private int MIN_SWITCH_TICKS;
36
37
    //might rename this to "AutoUse"
38
    public ItemSwitchSpeed() {
39
        super("itemswitchspeed", true, -1, 1, 0.999, 5000, "%player% failed item switch speed, VL: %vl%", null);
40
        lastSwitchTicks = new HashMap<>();
41
        usedSomething = new HashSet<>();
42
        MIN_SWITCH_TICKS = (int)customSetting("minSwitchTicks", "", 1);
43
    }
44
45
    //For future reference, if you try to verify that the item-switch packet points to a different slot, beware of falses.
46
    //The client can send item-switch packets regardless if the slot switched or not.
47
48
    @Override
49
    protected void check(Event event) {
50
        if(event instanceof InteractItemEvent || event instanceof InteractWorldEvent) {
51
            usedSomething.add(event.getPlayer().getUniqueId());
52
        }
53
        else if(event instanceof ItemSwitchEvent) {
54
55
            HawkPlayer pp = event.getHawkPlayer();
56
            UUID uuid = pp.getUuid();
57
58
            if(usedSomething.contains(uuid)) {
59
                long lastSwitchTick = lastSwitchTicks.getOrDefault(uuid, 0L);
60
                if(pp.getCurrentTick() - lastSwitchTick < MIN_SWITCH_TICKS) {
61
                    punish(pp, 1, false, event);
62
                }
63
                else {
64
                    reward(pp);
65
                }
66
67
                usedSomething.remove(uuid);
68
            }
69
70
            lastSwitchTicks.put(pp.getUuid(), pp.getCurrentTick());
71
        }
72
    }
73
74
    @Override
75
    public void removeData(Player p) {
76
        UUID uuid = p.getUniqueId();
77
        lastSwitchTicks.remove(uuid);
78
        usedSomething.remove(uuid);
79
    }
80
}

How it counteracts this module

Hawk's ItemSwitchSpeed marks a player as having used something on InteractItemEvent or InteractWorldEvent, then checks the next ItemSwitchEvent against the stored lastSwitchTick, punishing when the gap is under minSwitchTicks (default 1) and always consuming the usedSomething entry.\n\nRise's cycle sends C09(head) and the C08 use in the same tick, then the switch-back C09 one tick later, so the switch-back's delta is exactly 1 tick and the check rewards it at the default minimum of 1. Like AutoSoup, the module deliberately delays the slot restore by a full tick, and that one-tick margin is what keeps it under the default gate; raising minSwitchTicks to 2 makes every cycle flag. The absence of a drop packet does not change the math - the check only measures switches, and there is exactly one switch-back per cycle.

anticheat FastClick (window click rate, missed)

FastClick.java243 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.inventory;
16
17
import java.util.ArrayList;
18
import java.util.List;
19
20
import org.bukkit.Material;
21
import org.bukkit.entity.Player;
22
import org.bukkit.event.inventory.InventoryClickEvent;
23
import org.bukkit.event.inventory.InventoryType;
24
import org.bukkit.inventory.InventoryView;
25
import org.bukkit.inventory.ItemStack;
26
27
import fr.neatmonster.nocheatplus.actions.ParameterName;
28
import fr.neatmonster.nocheatplus.checks.Check;
29
import fr.neatmonster.nocheatplus.checks.CheckType;
30
import fr.neatmonster.nocheatplus.checks.ViolationData;
31
import fr.neatmonster.nocheatplus.checks.combined.Improbable;
32
import fr.neatmonster.nocheatplus.permissions.Permissions;
33
import fr.neatmonster.nocheatplus.players.IPlayerData;
34
import fr.neatmonster.nocheatplus.utilities.entity.InventoryUtil;
35
import fr.neatmonster.nocheatplus.utilities.StringUtil;
36
import fr.neatmonster.nocheatplus.utilities.TickTask;
37
38
39
/**
40
 * FastClick checks for players clicking in inventories too quickly (nerfs autosteal cheats and the like).
41
 */
42
public class FastClick extends Check {
43
44
45
    final List<String> tags = new ArrayList<String>();
46
47
48
    /**
49
     * Instantiates a new fast click check.
50
     */
51
    public FastClick() {
52
        super(CheckType.INVENTORY_FASTCLICK);
53
    }
54
55
56
   /**
57
    * Checks a player.
58
    * 
59
    * @param player
60
    * @param now Millisec
61
    * @param view
62
    * @param slot
63
    * @param cursor
64
    * @param clicked
65
    * @param isShiftClick
66
    * @param inventoryAction
67
    * @param data
68
    * @param cc 
69
    * @param pData
70
    * @return true, if successful
71
    */
72
    public boolean check(final Player player, final long now, 
73
                         final InventoryClickEvent event, final int slot, final ItemStack cursor, 
74
                         final ItemStack clicked, final boolean isShiftClick, 
75
                         final String inventoryAction, final InventoryData data, final InventoryConfig cc, 
76
                         final IPlayerData pData) {
77
78
        final float amount;
79
        final Material clickedMat = clicked == null ? Material.AIR : clicked.getType();
80
        final Material cursorMat;
81
        final int cursorAmount;
82
        boolean cancel = false;
83
        tags.clear();
84
85
        if (cursor != null) {
86
            cursorMat = cursor.getType();
87
            cursorAmount = Math.max(1, cursor.getAmount());
88
        }
89
        else {
90
            cursorMat = null;
91
            cursorAmount = 0;
92
        }
93
94
        if (inventoryAction != null) {
95
            amount = getAmountWithAction(event, slot, clicked, clickedMat, cursorMat, cursorAmount, isShiftClick, inventoryAction, data, cc);
96
        }
97
        else if (cursor != null) {
98
            // Detect shift-click features indirectly.
99
            amount = detectTweaks1_5(event, slot, clicked, clickedMat, cursorMat, cursorAmount, isShiftClick, data, cc);
100
        }
101
        else amount = 1f;
102
103
        if (isShiftClick && inventoryAction.equals("MOVE_TO_OTHER_INVENTORY") 
104
            && (cursorMat != null && cursorMat != Material.AIR) 
105
            && clickedMat != Material.AIR) {
106
            return false;
107
        }
108
        
109
        // Count clicks
110
        data.fastClickFreq.add(now, amount);
111
        
112
        // Shor-term VL
113
        float shortTerm = data.fastClickFreq.bucketScore(0);
114
        if (shortTerm > cc.fastClickShortTermLimit) {
115
            // Check for lag.
116
            shortTerm /= (float) TickTask.getLag(data.fastClickFreq.bucketDuration(), true);
117
        }
118
        shortTerm -= cc.fastClickShortTermLimit;
119
        
120
        // Normal VL
121
        float normal = data.fastClickFreq.score(1f);
122
        if (normal > cc.fastClickNormalLimit) {
123
            // Check for lag.
124
            normal /= (float) TickTask.getLag(data.fastClickFreq.bucketDuration() * data.fastClickFreq.numberOfBuckets(), true);
125
        }
126
        normal -= cc.fastClickNormalLimit;
127
        
128
        // Process Violations.
129
        final double violation = Math.max(shortTerm, normal);
130
        if (violation > 0.0) {
131
            tags.add("clickspeed");
132
            data.fastClickVL += violation;
133
            final ViolationData vd = new ViolationData(this, player, data.fastClickVL, violation, cc.fastClickActions);
134
            if (vd.needsParameters()) vd.setParameter(ParameterName.TAGS, StringUtil.join(tags, "+"));
135
            cancel = executeActions(vd).willCancel();
136
        }
137
        else data.fastClickVL *= 0.99;
138
139
        if (pData.isDebugActive(type) && pData.hasPermission(Permissions.ADMINISTRATION_DEBUG, player)) {
140
            player.sendMessage("FastClick: " + data.fastClickFreq.bucketScore(0) + " | " + data.fastClickFreq.score(1f) + " | cursor=" + cursor 
141
                                + " | clicked=" + clicked + " | action=" + inventoryAction);
142
        }
143
        
144
        // Adjust data
145
        data.fastClickLastClicked = clickedMat;
146
        data.fastClickLastSlot = slot;
147
        data.fastClickLastCursor = cursorMat;
148
        data.fastClickLastCursorAmount = cursorAmount;
149
150
        // Lastly, always feed the improbable.
151
        if (cc.fastClickImprobableWeight > 0.0f) {
152
            Improbable.feed(player, cc.fastClickImprobableWeight * amount, now);
153
        }
154
        return cancel;
155
    }
156
    
157
158
   /**
159
    * Enforce sane timings for interacting with the container and clicking in it.
160
    * 
161
    * @param player
162
    * @param data
163
    * @param cc
164
    */
165
    public boolean checkContainerInteraction(final Player player, final InventoryData data, final InventoryConfig cc) {
166
        boolean cancel = false;
167
        tags.clear();
168
        if (InventoryUtil.isContainerInteractionRecent(player, cc.chestOpenLimit)) {
169
            // Interaction was too quick, violation.
170
            tags.add("interact_time");
171
            long duration = Math.max(data.lastClickTime - data.containerInteractTime, 20);
172
            double violation = (cc.chestOpenLimit / duration) * 100D; // Normalize.
173
            data.fastClickVL += violation;
174
            final ViolationData vd = new ViolationData(this, player, data.fastClickVL, violation, cc.fastClickActions);
175
            if (vd.needsParameters()) vd.setParameter(ParameterName.TAGS, StringUtil.join(tags, "+"));
176
            cancel = executeActions(vd).willCancel();  
177
        }
178
       return cancel;
179
    }
180
    
181
182
   /**
183
    * Detect the inventory tweaks that were introduced in MC 1.5
184
    * 
185
    * @param view
186
    * @param slot
187
    * @param clicked
188
    * @param clickedMat
189
    * @param cursorAmount
190
    * @param isShiftClick
191
    * @param data
192
    * @param cc
193
    */
194
    private float detectTweaks1_5(final InventoryClickEvent event, final int slot, final ItemStack clicked, 
195
                                  final Material clickedMat, final Material cursorMat, 
196
                                  final int cursorAmount, final boolean isShiftClick, 
197
                                  final InventoryData data, final InventoryConfig cc) {
198
199
        if (cursorMat != data.fastClickLastCursor 
200
            && (!isShiftClick || clickedMat == Material.AIR || clickedMat != data.fastClickLastClicked) 
201
            || cursorMat == Material.AIR || cursorAmount != data.fastClickLastCursorAmount) {
202
            return 1f;
203
        }
204
        else if (clickedMat == Material.AIR || clickedMat == cursorMat 
205
                || isShiftClick && clickedMat == data.fastClickLastClicked ) {
206
            return Math.min(cc.fastClickNormalLimit , cc.fastClickShortTermLimit) 
207
                    / (float) (isShiftClick && clickedMat != Material.AIR ? (1.0 + Math.max(cursorAmount, InventoryUtil.getStackCount(event, clicked))) : cursorAmount)  * 0.75f;
208
        }
209
        return 1f;
210
    }
211
212
213
    private float getAmountWithAction(final InventoryClickEvent event, final int slot, final ItemStack clicked, 
214
                                      final Material clickedMat, final Material cursorMat, 
215
                                      final int cursorAmount, final boolean isShiftClick, 
216
                                      final String inventoryAction, 
217
                                      final InventoryData data, final InventoryConfig cc) {
218
219
        // Continuous drop feature with open inventories.
220
        if (inventoryAction.equals("DROP_ONE_SLOT")
221
            && slot == data.fastClickLastSlot 
222
            && clickedMat == data.fastClickLastClicked
223
            && event.getInventory().getType() == InventoryType.CRAFTING
224
            // && InventoryUtil.couldHaveInventoryOpen(player)
225
            // TODO: Distinguish if the inventory is really open.
226
            ) {
227
            return 0.6f;
228
        }
229
230
        // Collect to cursor.
231
        if (inventoryAction.equals("COLLECT_TO_CURSOR")) {
232
            final int stackCount = InventoryUtil.getStackCount(event, clicked);
233
            return stackCount <= 0 ? 1f : Math.min(cc.fastClickNormalLimit , cc.fastClickShortTermLimit) / stackCount * 0.75f;
234
        }
235
236
        // Shift click features.
237
        if ((inventoryAction.equals("MOVE_TO_OTHER_INVENTORY")) && cursorMat != Material.AIR) {
238
            // Let the legacy method do the side condition checks and counting for now.
239
            return detectTweaks1_5(event, slot, clicked, clickedMat, cursorMat, cursorAmount, isShiftClick, data, cc);
240
        }
241
        return 1f;
242
    }
243
}

How it counteracts this module

NoCheatPlus FastClick counts C0E inventory clicks into an ActionFrequency with five 200ms buckets, comparing the newest bucket against the short-term limit of 4 and the one-second window against the normal limit of 15, with lag division via TickTask. Only real window clicks feed the ledger.\n\nAutoHead never sends a C0E packet: slot selection is C09 held-item changes and the use is C08, so FastClick's ledger never increments regardless of eat rate. The check that exists to stop autosteal-style click spam is structurally blind to a C09/C08/C07 implementation, exactly as with the sibling AutoSoup and AutoGap modules. NCP's inventory countering for this module therefore falls entirely on the Open check and the use-item adapters rather than the click-rate path.

← Back to Analysis Hub