AntiAttack module

AntiAttack: Minecraft 26.3 cheat module, full source for every implementation (1 client: MelaHack (ThunderHack fork)).

1 implementationPLAYER

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.

MelaHack (ThunderHack fork)PLAYERsrc/main/java/thunder/hack/features/modules/misc/AntiAttack.javaJava · 48 lines · 1.9 KB

Prevents unnecessary attacks.

SettingsFriendZoglinVillagerOneHpHp
AntiAttack.javaJava · Minecraft 26.2 · 48 lines · 1.9 KB · complete file, verbatimOriginal ↗
1
package thunder.hack.features.modules.misc;
2
3
import meteordevelopment.orbit.EventHandler;
4
import net.minecraft.network.protocol.game.ServerboundInteractPacket;
5
import net.minecraft.world.entity.Entity;
6
import net.minecraft.world.entity.LivingEntity;
7
import net.minecraft.world.entity.monster.zombie.ZombifiedPiglin;
8
import net.minecraft.world.entity.npc.villager.Villager;
9
import org.jetbrains.annotations.NotNull;
10
import thunder.hack.core.Managers;
11
import thunder.hack.events.impl.PacketEvent;
12
import thunder.hack.features.modules.Module;
13
import thunder.hack.setting.Setting;
14
15
import static thunder.hack.features.modules.combat.Criticals.getEntity;
16
17
public final class AntiAttack extends Module {
18
    private final Setting<Boolean> friend = new Setting<>("Friend", true);
19
    private final Setting<Boolean> zoglin = new Setting<>("Zoglin", true);
20
    private final Setting<Boolean> villager = new Setting<>("Villager", false);
21
    private final Setting<Boolean> oneHp = new Setting<>("OneHp", false);
22
    private final Setting<Float> hp = new Setting<>("Hp", 1f, 0f, 20f, v -> oneHp.getValue());
23
24
    public AntiAttack() {
25
        super("AntiAttack", Category.PLAYER);
26
    }
27
28
    @EventHandler
29
    @SuppressWarnings("unused")
30
    private void onPacketSend(PacketEvent.@NotNull Send e) {
31
        if (e.getPacket() instanceof ServerboundInteractPacket pac) {
32
            Entity entity = getEntity(pac);
33
            if (entity == null) return;
34
            if (Managers.FRIEND.isFriend(entity.getName().getString()) && friend.getValue())
35
                e.cancel();
36
            if (entity instanceof ZombifiedPiglin && zoglin.getValue())
37
                e.cancel();
38
            if (entity instanceof Villager && villager.getValue()) {
39
                e.cancel();
40
            } else if (oneHp.getValue() && entity instanceof LivingEntity lent) {
41
                if (lent.getHealth() <= hp.getValue()) {
42
                    e.cancel();
43
                }
44
            }
45
        }
46
    }
47
}
48