Memeware 7.3 Breaker module 2 files, 102 lines

Memeware 7.3 Breaker: Full Source Analysis

Breaker, registered in the module list under the display name BlockFucker, is a C07 dig-packet spammer: every UpdateEvent it scans a 10 by 10 by 10 block cube around the player and, for every cake…

me/memewaredevs/client/module/misc/Breaker.java · GitHub source ↗

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

Packets This Module Uses

Analysis

Overview

Breaker, registered in the module list under the display name BlockFucker, is a C07 dig-packet spammer: every UpdateEvent it scans a 10 by 10 by 10 block cube around the player and, for every cake or end stone inside, sends a START_DESTROY_BLOCK followed immediately by STOP_DESTROY_BLOCK, both with the facing hardcoded to north. The packets go out through PacketUtil.sendPacketSilent, which writes straight to the NetworkManager and bypasses the client event bus. The Target Blocks selection and the Cake Check toggle are registered but never read; the handler is hardcoded to cake and end stone, and the breakBlock, pickaxeSlot, cakeBesideOrAt and cakeCovered helpers are dead code.

Scan and emission

The triple loop runs x from -5 to 4, y from 5 down to -4, and z from -5 to 4 relative to the player's block position, up to 1000 lookups per tick. Every block that is exactly Blocks.cake or Blocks.end_stone gets the START/STOP pair in the same tick with EnumFacing.NORTH, so a dense cake field emits two C07 packets per target per tick with no swing, no tool switch, and no facing that matches where the block actually sits.

Dead settings and dead helpers

The constructor registers a Target Blocks BlockSelectionSetting with cake, bed, wool and end stone defaults, but the handler never reads it: it fetches the setting object and then ignores it, testing the hardcoded pair instead. Cake Check is registered and never consulted. The private helpers breakBlock, pickaxeSlot, cakeBesideOrAt and cakeCovered implement a more careful breaker that never runs; pickaxeSlot even returns -10 as a sentinel. The shipped behavior is the bare cube scan, which means the module breaks blocks it is not looking at, never faces them, and never swings.

Silent send path

PacketUtil.sendPacketSilent calls mc.getNetHandler().getNetworkManager().sendPacket(packet), the same direct path the vanilla NetworkManager uses for queued traffic. Because it does not go through addToSendQueue or the client's packet event bus, no module that hooks outgoing packets (anti-bot filters, packet cancels) sees the dig stream, and the module cannot be throttled or filtered by its own client. The START/STOP pair is the module's entire wire footprint: no C0A swings accompany any dig.

source Breaker.java

Breaker.java86 lines · JavaOriginal ↗
1
2
package me.memewaredevs.client.module.misc;
3
4
import me.hippo.api.lwjeb.annotation.Handler;
5
import me.memewaredevs.client.Memeware;
6
import me.memewaredevs.client.event.events.UpdateEvent;
7
import me.memewaredevs.client.module.Module;
8
import me.memewaredevs.client.option.BlockSelectionSetting;
9
import me.memewaredevs.client.util.packet.PacketUtil;
10
import net.minecraft.block.Block;
11
import net.minecraft.init.Blocks;
12
import net.minecraft.item.ItemPickaxe;
13
import net.minecraft.item.ItemStack;
14
import net.minecraft.network.play.client.C07PacketPlayerDigging;
15
import net.minecraft.util.BlockPos;
16
import net.minecraft.util.EnumFacing;
17
18
import java.util.ArrayList;
19
import java.util.function.Consumer;
20
21
public class Breaker extends Module {
22
    public Breaker() {
23
        super("BlockFucker", 0, Module.Category.MISC);
24
        ArrayList<Block> defaultList = new ArrayList<>();
25
        defaultList.add(Blocks.cake);
26
        defaultList.add(Blocks.bed);
27
        defaultList.add(Blocks.wool);
28
        defaultList.add(Blocks.end_stone);
29
        this.addBlockSelection("Target Blocks", defaultList);
30
        this.addBoolean("Cake Check", true);
31
    }
32
33
    @Handler
34
    public Consumer<UpdateEvent> onEvent = (event) -> {
35
        final int radius = 5;
36
        BlockSelectionSetting setting = (BlockSelectionSetting) Memeware.INSTANCE.getSettingsManager().getSettingByMod(this.getClass(), "Target Blocks");
37
        for (int x = -radius; x < radius; ++x) {
38
            for (int y2 = radius; y2 > -radius; --y2) {
39
                for (int z = -radius; z < radius; ++z) {
40
                    final int xPos = (int) this.mc.thePlayer.posX + x;
41
                    final int yPos = (int) this.mc.thePlayer.posY + y2;
42
                    final int zPos = (int) this.mc.thePlayer.posZ + z;
43
                    final BlockPos blockPos = new BlockPos(xPos, yPos, zPos);
44
                    final Block block = this.mc.theWorld.getBlockState(blockPos).getBlock();
45
                    if (block == Blocks.cake || block == Blocks.end_stone) {
46
                        PacketUtil.sendPacketSilent(new C07PacketPlayerDigging(C07PacketPlayerDigging.Action.START_DESTROY_BLOCK, blockPos, EnumFacing.NORTH));
47
                        PacketUtil.sendPacketSilent(new C07PacketPlayerDigging(C07PacketPlayerDigging.Action.STOP_DESTROY_BLOCK, blockPos, EnumFacing.NORTH));
48
                    }
49
                }
50
            }
51
        }
52
    };
53
54
    private void breakBlock(BlockPos blockPos) {
55
        PacketUtil.sendPacketSilent(new C07PacketPlayerDigging(C07PacketPlayerDigging.Action.START_DESTROY_BLOCK, blockPos, EnumFacing.NORTH));
56
        PacketUtil.sendPacketSilent(new C07PacketPlayerDigging(C07PacketPlayerDigging.Action.STOP_DESTROY_BLOCK, blockPos, EnumFacing.NORTH));
57
    }
58
59
    private int pickaxeSlot() {
60
        for (int j = 0; j < 8; ++j) {
61
            ItemStack stack = mc.thePlayer.inventory.mainInventory[j];
62
            if (stack != null && stack.getItem() instanceof ItemPickaxe) {
63
                return j;
64
            }
65
        }
66
        return -10;
67
    }
68
69
    private boolean cakeBesideOrAt(BlockPos blockPos) {
70
        for (EnumFacing face : new EnumFacing[] {EnumFacing.NORTH, EnumFacing.SOUTH, EnumFacing.WEST, EnumFacing.EAST, EnumFacing.DOWN}) {
71
            if (mc.theWorld.getBlockState(blockPos.offset(face)).getBlock() == Blocks.cake) {
72
                return true;
73
            }
74
        }
75
        return mc.theWorld.getBlockState(blockPos).getBlock() == Blocks.cake;
76
    }
77
78
    private boolean cakeCovered(BlockPos blockPos) {
79
        for (EnumFacing face : new EnumFacing[] {EnumFacing.NORTH, EnumFacing.SOUTH, EnumFacing.WEST, EnumFacing.EAST, EnumFacing.UP}) {
80
            if (mc.theWorld.getBlockState(blockPos.offset(face)).getBlock() == Blocks.air) {
81
                return false;
82
            }
83
        }
84
        return true;
85
    }
86
}

What this file does

The module file shows both the shipped behavior and the abandoned design. The UpdateEvent handler contains the live logic: the triple scan loop, the hardcoded cake and end stone test, and the two sendPacketSilent calls that emit the START/STOP pair with EnumFacing.NORTH. The constructor registers Target Blocks and Cake Check, which the handler never consults, and the four private helpers below the handler are unreachable dead code. The module constructs with the display name BlockFucker under the misc category and no key binding.

source PacketUtil.java (silent send)

PacketUtil.java16 lines · JavaOriginal ↗
1
package me.memewaredevs.client.util.packet;
2
3
import me.memewaredevs.client.util.misc.MinecraftUtil;
4
import net.minecraft.network.Packet;
5
6
public class PacketUtil implements MinecraftUtil {
7
8
    public static void sendPacketSilent(Packet packet) {
9
        mc.getNetHandler().getNetworkManager().sendPacket(packet);
10
    }
11
12
    public static void sendPacket(Packet packet) {
13
        mc.thePlayer.sendQueue.addToSendQueue(packet);
14
    }
15
16
}

What this file does

PacketUtil is the two-line send wrapper the module uses for every C07. sendPacketSilent resolves the player's NetworkManager through the net handler and calls sendPacket directly, which is why the dig stream bypasses addToSendQueue and the client event bus; sendPacket is the normal queued path used elsewhere in the client. The distinction matters because the silent path keeps the Breaker's traffic invisible to the client's own packet hooks, so no other module can filter or react to the dig stream.

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 FastBreak (zero-duration digs)

FastBreak.java135 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.blockbreak;
16
17
import org.bukkit.Material;
18
import org.bukkit.block.Block;
19
import org.bukkit.entity.Player;
20
import org.bukkit.inventory.ItemStack;
21
22
import fr.neatmonster.nocheatplus.actions.ParameterName;
23
import fr.neatmonster.nocheatplus.checks.Check;
24
import fr.neatmonster.nocheatplus.checks.CheckType;
25
import fr.neatmonster.nocheatplus.checks.ViolationData;
26
import fr.neatmonster.nocheatplus.compat.AlmostBoolean;
27
import fr.neatmonster.nocheatplus.compat.Bridge1_9;
28
import fr.neatmonster.nocheatplus.compat.bukkit.BridgePotionEffect;
29
import fr.neatmonster.nocheatplus.permissions.Permissions;
30
import fr.neatmonster.nocheatplus.players.IPlayerData;
31
import fr.neatmonster.nocheatplus.utilities.TickTask;
32
import fr.neatmonster.nocheatplus.utilities.entity.PotionUtil;
33
import fr.neatmonster.nocheatplus.utilities.map.BlockProperties;
34
35
/**
36
 * A check used to verify if the player is breaking blocks faster than possible.
37
 */
38
public class FastBreak extends Check {
39
40
    /**
41
     * Instantiates a new fast break check.
42
     */
43
    public FastBreak() {
44
        super(CheckType.BLOCKBREAK_FASTBREAK);
45
    }
46
47
    /**
48
     * Checks a player for fastbreak. This is NOT for creative mode.
49
     * @return true, if successful
50
     */
51
    public boolean check(final Player player, final Block block, final AlmostBoolean isInstaBreak, final BlockBreakConfig cc, final BlockBreakData data, final IPlayerData pData) {
52
        final long now = System.currentTimeMillis();
53
        boolean cancel = false;
54
        // Determine expected breaking time by block type.
55
        final Material blockType = block.getType();
56
        final long expectedBreakingTime = Math.max(0, Math.round((double) BlockProperties.getBreakingDuration(blockType, player) * (double) cc.fastBreakModSurvival / 100D));
57
        final long elapsedTime;
58
        // Counting interact...break.
59
        // TODO: Concept for unbreakable blocks? Context: extreme VL.
60
        // TODO: Should it be breakingTime instead of 0 for inconsistencies?
61
        elapsedTime = cc.fastBreakStrict ? (data.fastBreakBreakTime > data.fastBreakfirstDamage) ? 0 : now - data.fastBreakfirstDamage
62
                                         // Counting break...break.
63
                                         : (data.fastBreakBreakTime > now) ? 0 : now - data.fastBreakBreakTime;
64
65
        // Check if the time spent is lower than expected.
66
        if (isInstaBreak.decideOptimistically()) {
67
            // Ignore these for now.
68
            // TODO: Find out why this was commented out long ago a) did not fix mcMMO b) exploits.
69
            // TODO: Maybe adjust time to min(time, SOMETHING) for MAYBE/YES.
70
        }
71
        else if (elapsedTime < 0) {
72
            // Ignore it. TODO: ?
73
        }
74
        else if (elapsedTime + cc.fastBreakDelay < expectedBreakingTime) {
75
            // Lag or cheat or Minecraft.
76
            // Count in server side lag, if desired.
77
            final float serverLagFactor = pData.getCurrentWorldDataSafe().shouldAdjustToLag(type) ? TickTask.getLag(expectedBreakingTime, true) : 1f;
78
            final long missingTime = expectedBreakingTime - (long)(serverLagFactor * elapsedTime);
79
            if (missingTime > 0) {
80
                // Add as penalty
81
                data.fastBreakPenalties.add(now, (float) missingTime);
82
                // Only raise a violation, if the total penalty score exceeds the contention duration (for lag, delay).
83
                if (data.fastBreakPenalties.score(cc.fastBreakBucketFactor) > cc.fastBreakGrace) {
84
                    // TODO: maybe add one absolute penalty time for big amounts to stop breaking until then
85
                    final double violation = (double) missingTime / 1000.0;
86
                    data.fastBreakVL += violation;
87
                    final ViolationData vd = new ViolationData(this, player, data.fastBreakVL, violation, cc.fastBreakActions);
88
                    if (vd.needsParameters()) {
89
                        vd.setParameter(ParameterName.BLOCK_TYPE, blockType.toString());
90
                    }
91
                    cancel = executeActions(vd).willCancel();
92
                }
93
                // else: still within contention limits.
94
            }
95
        }
96
        else if (expectedBreakingTime > cc.fastBreakDelay) {
97
            // Fast breaking does not decrease violation level.
98
            data.fastBreakVL *= 0.9D;
99
        }
100
101
        // TODO: Rework to use (then hopefully completed) BlockBreakKey.
102
        if (pData.isDebugActive(type)) {
103
            detailDebugStats(player, isInstaBreak, blockType, elapsedTime, expectedBreakingTime, data, pData);
104
        }
105
        else {
106
            data.stats = null;
107
        }
108
        // (The break time is set in the listener).
109
        return cancel;
110
    }
111
112
    private void detailDebugStats(final Player player, final AlmostBoolean isInstaBreak,
113
                                  final Material blockType, final long elapsedTime, final long expectedBreakingTime,
114
                                  final BlockBreakData data, final IPlayerData pData) {
115
        if (pData.hasPermission(Permissions.ADMINISTRATION_DEBUG, player)) {
116
            // General stats:
117
            // TODO: Replace stats by new system (BlockBreakKey once complete), commands to inspect / auto-config.
118
            data.setStats();
119
            data.stats.addStats(data.stats.getId(blockType+ "/u", true), elapsedTime);
120
            data.stats.addStats(data.stats.getId(blockType + "/r", true), expectedBreakingTime);
121
            player.sendMessage(data.stats.getStatsStr(true));
122
            // Send info about current break:
123
            final ItemStack stack = Bridge1_9.getItemInMainHand(player);
124
            final boolean isValidTool = BlockProperties.isValidTool(blockType, stack);
125
            final double haste = PotionUtil.getPotionEffectAmplifier(player, BridgePotionEffect.HASTE);
126
            String msg = (isInstaBreak.decideOptimistically() ? ("[Insta=" + isInstaBreak + "]") : "[Normal]") + "[" + blockType + "] "+ elapsedTime + "u / " + expectedBreakingTime +"r (" + (isValidTool?"tool":"no-tool") + ")" + (Double.isInfinite(haste) ? "" : " haste=" + ((int) haste + 1));
127
            player.sendMessage(msg);
128
            //          net.minecraft.server.Item mcItem = net.minecraft.server.Item.byId[stack.getTypeId()];
129
            //          if (mcItem != null) {
130
            //              double x = mcItem.getDestroySpeed(((CraftItemStack) stack).getHandle(), net.minecraft.server.Block.byId[blockId]);
131
            //              player.sendMessage("mc speed: " + x);
132
            //          }
133
        }
134
    }
135
}

How it counteracts this module

FastBreak runs inside BlockBreakListener.onBlockBreak, so it only sees digs that end in a real harvest, which is the module's whole purpose. The check computes the expected breaking time from the block's hardness (round of getBreakingDuration times fastBreakModSurvival over 100) and compares it with the elapsed time since the first damage packet. The module's START/STOP pair in one tick presents an elapsed time of a few milliseconds against cake's roughly 750ms and end stone's roughly 1.2 second expectations when dug by hand, so every harvest adds a missingTime penalty of about 740 to 1190ms to the fastBreakPenalties bucket.

The bucket tolerates a grace of 2000ms of accumulated missing time (fastBreakGrace default) before the violation tier triggers, so isolated breaks pass. A cake farm with several cakes in the cube harvests dozens of blocks per second and exhausts the grace in a fraction of a second; after that, every pair adds to the violation. The honest caveat is the event path: servers or plugins that reject the instant dig never fire BlockBreakEvent, and on those setups this check (and the other NCP blockbreak checks) stays silent while packet-level checks elsewhere in the stack are the ones that see the stream.

anticheat NoSwing (digs without arm movement)

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

How it counteracts this module

NCP requires one arm swing between breaks. NoSwing increments a per-player counter on every break check and decrements it when a PlayerAnimationEvent (a C0A swing) arrives; a counter above 1 at break time is a violation, otherwise the violation level decays. The module never sends a swing, so the counter climbs on every consecutive harvest and the check flags the second break onward, adding 1 to noSwingVL per pair.

Because the scan emits pairs for every cake and end stone in the cube each tick, consecutive harvests are guaranteed whenever two or more targets exist, and even a single target produces back-to-back flags once a second sweep lands in the same tick window. The check counts swings and breaks only, so the silent send path does not hide it.

anticheat Direction (facing of the clicked face)

Direction.java52 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.blockbreak;
16
17
import org.bukkit.entity.Player;
18
19
import fr.neatmonster.nocheatplus.actions.ActionList;
20
import fr.neatmonster.nocheatplus.checks.CheckType;
21
import fr.neatmonster.nocheatplus.checks.generic.block.AbstractBlockDirectionCheck;
22
23
/**
24
 * The Direction check will find out if a player tried to interact with
25
 * something that's not in their field of view.
26
 */
27
public class Direction extends AbstractBlockDirectionCheck<BlockBreakData, BlockBreakConfig> {
28
29
    /**
30
     * Instantiates a new direction check.
31
     */
32
    public Direction() {
33
        super(CheckType.BLOCKBREAK_DIRECTION);
34
    }
35
36
    @Override
37
    protected double addVL(Player player, double distance, BlockBreakData data, BlockBreakConfig cc) {
38
        data.directionVL += distance;
39
        return data.directionVL;
40
    }
41
42
    @Override
43
    protected ActionList getActions(BlockBreakConfig cc) {
44
        return cc.directionActions;
45
    }
46
47
    @Override
48
    protected void cooldown(Player player, BlockBreakData data, BlockBreakConfig cc) {
49
        data.directionVL *= 0.9D;
50
    }
51
52
}

How it counteracts this module

The module claims EnumFacing.NORTH for every dig regardless of where the block sits relative to the player. NCP's direction check computes the distance between the clicked face and the ray cast from the player's eye position along the current look direction, and accumulates that distance into directionVL, decaying it by 0.9 per event when the ray does hit the claimed face. A block above, below, or behind the player with a NORTH claim fails the ray test by the full face-to-ray distance.

Only a block whose north face happens to intersect the player's current view ray passes, which for a fixed facing means exactly the thin slice directly north of the eye. Every other harvest in the cube adds its face-to-ray distance to the violation, and with the per-tick multi-block emission the accumulation is effectively continuous. The check runs from the same BlockBreakEvent path, so it shares the caveat that a server rejecting the instant dig sees nothing.

anticheat Reach (dig distance)

Reach.java83 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.blockbreak;
16
17
import org.bukkit.GameMode;
18
import org.bukkit.Location;
19
import org.bukkit.block.Block;
20
import org.bukkit.entity.Player;
21
22
import fr.neatmonster.nocheatplus.actions.ParameterName;
23
import fr.neatmonster.nocheatplus.checks.Check;
24
import fr.neatmonster.nocheatplus.checks.CheckType;
25
import fr.neatmonster.nocheatplus.checks.ViolationData;
26
import fr.neatmonster.nocheatplus.utilities.StringUtil;
27
import fr.neatmonster.nocheatplus.utilities.math.TrigUtil;
28
29
/**
30
 * The Reach check will find out if a player breaks a block that's too far away.
31
 */
32
public class Reach extends Check {
33
34
    /** For temporary use: LocUtil.clone before passing deeply, call setWorld(null) after use. */
35
    private final Location useLoc = new Location(null, 0, 0, 0);
36
37
    /** The maximum distance allowed to interact with a block in creative mode. */
38
    public static final double CREATIVE_DISTANCE = 5.6D;
39
40
    /** The maximum distance allowed to interact with a block in survival mode. */
41
    public static final double SURVIVAL_DISTANCE = 5.2D;
42
43
    /**
44
     * Instantiates a new reach check.
45
     */
46
    public Reach() {
47
        super(CheckType.BLOCKBREAK_REACH);
48
    }
49
50
    /**
51
     * Checks a player.
52
     * 
53
     * @param player
54
     * @param eyeHeight 
55
     * @param block
56
     * @param data
57
     * @param cc
58
     * @return true, if successful
59
     */
60
    public boolean check(final Player player, final double eyeHeight, final Block block, final BlockBreakData data, final BlockBreakConfig cc) {
61
    	// TODO: Ray tracing-based?
62
        boolean cancel = false;
63
        final double distanceLimit = player.getGameMode() == GameMode.CREATIVE ? CREATIVE_DISTANCE : SURVIVAL_DISTANCE; 
64
        final Location loc = player.getLocation(useLoc);
65
        loc.setY(loc.getY() + eyeHeight);
66
         // Distance is calculated from eye location to center of targeted block.
67
        final double distance = TrigUtil.distance(loc, block) - distanceLimit;
68
        useLoc.setWorld(null);
69
70
        if (distance > distanceLimit) {
71
            // They failed, increment violation level.
72
            data.reachVL += distance - distanceLimit;
73
            // Execute whatever actions are associated with this check and the violation level and find out if we should
74
            // cancel the event.
75
            final ViolationData vd = new ViolationData(this, player, data.reachVL, distance, cc.reachActions);
76
            vd.setParameter(ParameterName.REACH_DISTANCE, StringUtil.fdec3.format(distance));
77
            cancel = executeActions(vd).willCancel();
78
        } 
79
        // Player passed the check, reward them.
80
        else data.reachVL *= 0.9D;
81
        return cancel;
82
    }
83
}

How it counteracts this module

NCP blockbreak Reach enforces a survival interaction distance of 5.2 blocks from the eye to the block (5.6 in creative). The scan's wide offsets put many targets past that bound: a block four blocks out on x and z at eye level measures about 5.7 blocks, and the far corners with a vertical offset of 4 reach 6.1 to 6.6 blocks from an eye at 1.62. Each out-of-range harvest adds the excess (distance minus 5.2) to reachVL, with the level decaying by 0.9 on in-range breaks.

The reach profile is therefore a function of where the targets sit: cakes at the scan edge are always violations, cakes close to the player pass. A bedwars or cake-farm setup where the target clusters sit several blocks away produces a steady violation stream, and the first tier of the default actions cancels the break once the level crosses its threshold. Like the other blockbreak checks, it fires on real harvests, so the module's own function, breaking the blocks, is what exposes it.

← Back to Analysis Hub