MessageAura module

MessageAura: Minecraft 26.3 cheat module, full source for every implementation (1 client: OfflineClient).

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.

OfflineClientMISCsrc/main/java/com/jellypudding/offlineclient/modules/misc/MessageAura.javaJava · 95 lines · 3.2 KB

Sends a private message to every player who comes into view.

SettingsMessageIgnore friendsOnce eachDelay
MessageAura.javaJava · Minecraft 26.2 · 95 lines · 3.2 KB · complete file, verbatimOriginal ↗
1
package com.jellypudding.offlineclient.modules.misc;
2
3
import com.jellypudding.offlineclient.OfflineClient;
4
import com.jellypudding.offlineclient.event.Subscribe;
5
import com.jellypudding.offlineclient.event.events.EntityAddedEvent;
6
import com.jellypudding.offlineclient.event.events.TickEvent;
7
import com.jellypudding.offlineclient.module.Category;
8
import com.jellypudding.offlineclient.module.Module;
9
import com.jellypudding.offlineclient.setting.BoolSetting;
10
import com.jellypudding.offlineclient.setting.NumberSetting;
11
import com.jellypudding.offlineclient.setting.TextSetting;
12
import net.minecraft.world.entity.player.Player;
13
14
import java.util.ArrayDeque;
15
import java.util.Deque;
16
import java.util.LinkedHashSet;
17
import java.util.Locale;
18
19
// Sends a private message to every player the moment they come into view.
20
public final class MessageAura extends Module {
21
22
    // Names remembered. One player is only messaged once a session.
23
    private static final int MAX_TRACKED = 512;
24
25
    private final TextSetting message = new TextSetting("Message",
26
        "What every player is told. Click to type it.", "Offline on top");
27
    private final BoolSetting ignoreFriends = new BoolSetting("Ignore friends",
28
        "Leaves people on your friend list alone.", false);
29
    private final BoolSetting once = new BoolSetting("Once each",
30
        "Messages a player only the first time you see them.", true);
31
    private final NumberSetting delay = new NumberSetting("Delay",
32
        "Ticks between one message and the next.", 20, 0, 200, 1, " ticks").min(0).max(1200);
33
34
    private final Deque<String> queue = new ArrayDeque<>();
35
    private final LinkedHashSet<String> told = new LinkedHashSet<>();
36
    private int timer;
37
38
    public MessageAura() {
39
        super("MessageAura", "Sends a private message to every player who comes into view.",
40
            Category.MISC);
41
        addSettings(message, ignoreFriends, once, delay);
42
        searchTags("msg", "whisper", "advert");
43
    }
44
45
    @Override
46
    public String getSuffix() {
47
        return count(queue.size());
48
    }
49
50
    @Override
51
    protected void onEnable() {
52
        queue.clear();
53
        told.clear();
54
        timer = 0;
55
    }
56
57
    @Override
58
    protected void onDisable() {
59
        queue.clear();
60
        told.clear();
61
    }
62
63
    @Subscribe
64
    private void onEntityAdded(EntityAddedEvent event) {
65
        if (!(event.getEntity() instanceof Player player) || player == mc.player) {
66
            return;
67
        }
68
        String name = player.getGameProfile().name();
69
        if (name.isBlank() || (ignoreFriends.isOn()
70
            && OfflineClient.INSTANCE.getFriendManager().isFriend(name))) {
71
            return;
72
        }
73
        String key = name.toLowerCase(Locale.ROOT);
74
        if (once.isOn() && !told.add(key)) {
75
            return;
76
        }
77
        if (told.size() > MAX_TRACKED) {
78
            told.removeFirst();
79
        }
80
        queue.addLast(name);
81
    }
82
83
    @Subscribe
84
    private void onTick(TickEvent event) {
85
        if (queue.isEmpty() || mc.getConnection() == null || message.isBlank()) {
86
            return;
87
        }
88
        if (--timer > 0) {
89
            return;
90
        }
91
        timer = delay.getInt();
92
        mc.getConnection().sendCommand("msg " + queue.removeFirst() + " " + message.getValue());
93
    }
94
}
95