packet-canceller module

packet-canceller: Minecraft 26.3 cheat module, full source for every implementation (1 client: Meteor Client).

1 implementationMisc

Clients with this module

Full module source: 1 implementation

Every implementation below is the complete module file, verbatim. Expand a client to read its code.

Meteor ClientMiscsrc/main/java/meteordevelopment/meteorclient/systems/modules/misc/PacketCanceller.javaJava · 54 lines · 2.0 KB

Allows you to cancel certain packets.

SettingsS2C-packetsC2S-packets
PacketCanceller.javaJava · Minecraft 26.2 · 54 lines · 2.0 KB · complete file, verbatimOriginal ↗
1
/*
2
 * This file is part of the Meteor Client distribution (https://github.com/MeteorDevelopment/meteor-client).
3
 * Copyright (c) Meteor Development.
4
 */
5
6
package meteordevelopment.meteorclient.systems.modules.misc;
7
8
import meteordevelopment.meteorclient.events.packets.PacketEvent;
9
import meteordevelopment.meteorclient.settings.PacketListSetting;
10
import meteordevelopment.meteorclient.settings.Setting;
11
import meteordevelopment.meteorclient.settings.SettingGroup;
12
import meteordevelopment.meteorclient.systems.modules.Categories;
13
import meteordevelopment.meteorclient.systems.modules.Module;
14
import meteordevelopment.orbit.EventHandler;
15
import meteordevelopment.orbit.EventPriority;
16
import net.minecraft.network.protocol.Packet;
17
import net.minecraft.network.protocol.PacketType;
18
import org.jspecify.annotations.NonNull;
19
20
import java.util.Set;
21
22
public class PacketCanceller extends Module {
23
    private final SettingGroup sgGeneral = settings.getDefaultGroup();
24
25
    private final Setting<Set<PacketType<? extends @NonNull Packet<?>>>> s2cPackets = sgGeneral.add(new PacketListSetting.Builder()
26
        .name("S2C-packets")
27
        .description("Server-to-client packets to cancel.")
28
        .clientbound()
29
        .build()
30
    );
31
32
    private final Setting<Set<PacketType<? extends @NonNull Packet<?>>>> c2sPackets = sgGeneral.add(new PacketListSetting.Builder()
33
        .name("C2S-packets")
34
        .description("Client-to-server packets to cancel.")
35
        .serverbound()
36
        .build()
37
    );
38
39
    public PacketCanceller() {
40
        super(Categories.Misc, "packet-canceller", "Allows you to cancel certain packets.");
41
        runInMainMenu = true;
42
    }
43
44
    @EventHandler(priority = EventPriority.HIGHEST + 1)
45
    private void onReceivePacket(PacketEvent.Receive event) {
46
        if (s2cPackets.get().contains(event.packet.type())) event.cancel();
47
    }
48
49
    @EventHandler(priority = EventPriority.HIGHEST + 1)
50
    private void onSendPacket(PacketEvent.Send event) {
51
        if (c2sPackets.get().contains(event.packet.type())) event.cancel();
52
    }
53
}
54