VisualRange module

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

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.

MelaHack (ThunderHack fork)MISCsrc/main/java/thunder/hack/features/modules/misc/VisualRange.javaJava · 90 lines · 3.5 KB

Alerts you about players in the visual range.

SettingsLeaveEnterFriendsSoundMode
VisualRange.javaJava · Minecraft 26.2 · 90 lines · 3.5 KB · complete file, verbatimOriginal ↗
1
package thunder.hack.features.modules.misc;
2
3
import meteordevelopment.orbit.EventHandler;
4
import net.minecraft.ChatFormatting;
5
import net.minecraft.sounds.SoundEvents;
6
import net.minecraft.sounds.SoundSource;
7
import net.minecraft.world.entity.Entity;
8
import net.minecraft.world.entity.player.Player;
9
import thunder.hack.core.Managers;
10
import thunder.hack.core.manager.client.ModuleManager;
11
import thunder.hack.events.impl.EventEntityRemoved;
12
import thunder.hack.events.impl.EventEntitySpawn;
13
import thunder.hack.features.modules.Module;
14
import thunder.hack.gui.notification.Notification;
15
import thunder.hack.setting.Setting;
16
17
import java.util.ArrayList;
18
19
public class VisualRange extends Module {
20
    private static final ArrayList<String> entities = new ArrayList<>();
21
    private final Setting<Boolean> leave = new Setting<>("Leave", true);
22
    private final Setting<Boolean> enter = new Setting<>("Enter", true);
23
    private final Setting<Boolean> friends = new Setting<>("Friends", true);
24
    private final Setting<Boolean> soundpl = new Setting<>("Sound", true);
25
    private final Setting<Mode> mode = new Setting<>("Mode", Mode.Notification);
26
27
    public VisualRange() {
28
        super("VisualRange", Category.MISC);
29
    }
30
31
    @EventHandler
32
    public void onEntityAdded(EventEntitySpawn event) {
33
        if (!isValid(event.getEntity())) return;
34
35
        if (!entities.contains(event.getEntity().getName().getString()))
36
            entities.add(event.getEntity().getName().getString());
37
        else return;
38
39
        if (enter.getValue()) notify(event.getEntity(), true);
40
    }
41
42
    @EventHandler
43
    public void onEntityRemoved(EventEntityRemoved event) {
44
        if (!isValid(event.entity)) return;
45
46
        if (entities.contains(event.entity.getName().getString())) entities.remove(event.entity.getName().getString());
47
        else return;
48
49
        if (leave.getValue()) notify(event.entity, false);
50
    }
51
52
    public void notify(Entity entity, boolean enter) {
53
        String message = "";
54
        if (ModuleManager.nameProtect.isEnabled() && NameProtect.hideFriends.getValue()) {
55
            message = ChatFormatting.AQUA + NameProtect.newName.getValue();
56
        }
57
        if (Managers.FRIEND.isFriend(entity.getName().getString()))
58
            message = ChatFormatting.AQUA + entity.getName().getString();
59
        else message = ChatFormatting.GRAY + entity.getName().getString();
60
61
62
        if (enter) message += ChatFormatting.GREEN + " was found!";
63
        else message += ChatFormatting.RED + " left to X:" + (int) entity.getX() + " Z:" + (int) entity.getZ();
64
65
        if (mode.is(Mode.Chat) || mode.is(Mode.Both)) sendMessage(message);
66
67
        if (mode.is(Mode.Notification) || mode.is(Mode.Both))
68
            Managers.NOTIFICATION.publicity("VisualRange", message, 2, Notification.Type.WARNING);
69
70
        if (soundpl.getValue()) {
71
            try {
72
                if (enter)
73
                    mc.level.playSound(mc.player, mc.player.blockPosition(), SoundEvents.PLAYER_LEVELUP, SoundSource.BLOCKS, 1f, 1f);
74
                else
75
                    mc.level.playSound(mc.player, mc.player.blockPosition(), SoundEvents.EXPERIENCE_ORB_PICKUP, SoundSource.BLOCKS, 1f, 1f);
76
            } catch (Exception ignored) {
77
            }
78
        }
79
    }
80
81
    public boolean isValid(Entity entity) {
82
        if (!(entity instanceof Player)) return false;
83
        return entity != mc.player && (!Managers.FRIEND.isFriend(entity.getName().getString()) || friends.getValue());
84
    }
85
86
    public enum Mode {
87
        Chat, Notification, Both
88
    }
89
}
90