ShitDropper module

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

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.

CombatantPLAYERsrc/main/java/combatant/client/features/module/modules/player/ShitDropper.javaJava · 137 lines · 4.2 KB
SettingsshitDropperTrashItemsshitDropperMaxTrashSlotsshitDropperStacksPerTickshitDropperDelayTicks
ShitDropper.javaJava · Minecraft 26.2 · 137 lines · 4.2 KB · complete file, verbatimOriginal ↗
1
/*
2
 * This file is part of the Combatant Client distribution.
3
 * Copyright (c) 2026 pivosos2007.
4
 *
5
 * Licensed under the GNU General Public License v3.0.
6
 */
7
8
package combatant.client.features.module.modules.player;
9
10
import net.minecraft.client.Minecraft;
11
import net.minecraft.core.registries.BuiltInRegistries;
12
import combatant.client.config.values.ItemIdSetValue;
13
import combatant.client.config.values.NumberValue;
14
import combatant.client.features.gui.clickgui.settings.TextListSetting;
15
import combatant.client.features.module.Module;
16
import combatant.client.features.module.ModuleCategory;
17
import combatant.client.features.module.ModuleInfo;
18
import combatant.client.util.player.inventory.InventorySwap;
19
20
import java.util.ArrayList;
21
import java.util.List;
22
23
//todo Description
24
@ModuleInfo(
25
        id = "shitdropper",
26
        displayName = "ShitDropper",
27
        category = ModuleCategory.PLAYER
28
)
29
public class ShitDropper extends Module {
30
31
    private static final Minecraft mc = Minecraft.getInstance();
32
33
    private static final String SETTING_TRASH_ITEM_IDS = "trash_item_ids";
34
    private static final String SETTING_MAX_TRASH_SLOTS = "max_trash_slots";
35
    private static final String SETTING_STACKS_PER_TICK = "stacks_per_tick";
36
    private static final String SETTING_DELAY_TICKS = "delay_ticks";
37
    private final ItemIdSetValue trashItemsValue =
38
            itemList("shitDropperTrashItems", SETTING_TRASH_ITEM_IDS, TextListSetting.PickerMode.ALL);
39
40
    /**
41
     * How many trash stacks are allowed to exist simultaneously in occupied slots. 0 = drop all.
42
     */
43
    private final NumberValue<Integer> maxTrashSlotsValue = num(
44
            "shitDropperMaxTrashSlots",
45
            SETTING_MAX_TRASH_SLOTS,
46
            0,
47
            0,
48
            36
49
    );
50
51
    /**
52
     * Maximum amount of stacks to drop per tick (to reduce server spam).
53
     */
54
    private final NumberValue<Integer> stacksPerTickValue = num(
55
            "shitDropperStacksPerTick",
56
            SETTING_STACKS_PER_TICK,
57
            1,
58
            1,
59
            9
60
    );
61
62
    /**
63
     * Delay between drop batches (ticks).
64
     */
65
    private final NumberValue<Integer> delayTicksValue = num(
66
            "shitDropperDelayTicks",
67
            SETTING_DELAY_TICKS,
68
            2,
69
            0,
70
            40
71
    );
72
73
    private int cooldownTicks;
74
75
    @Override
76
    public void onEnable() {
77
        cooldownTicks = 0;
78
    }
79
80
    @Override
81
    public void onTick() {
82
        if (!isEnabled() || mc.player == null || mc.gameMode == null) return;
83
84
        var handler = mc.player.containerMenu;
85
        if (handler == null) return;
86
87
        if (!handler.getCarried().isEmpty()) return;
88
89
        if (cooldownTicks > 0) {
90
            cooldownTicks--;
91
            return;
92
        }
93
94
        var targets = trashItemsValue.get();
95
        if (targets == null || targets.isEmpty()) return;
96
97
        // Ищем мусор только в PlayerInventory именно нашего игрока, индексы 0..35
98
        List<Integer> trashSlots = new ArrayList<>();
99
100
        for (int screenSlot = 0; screenSlot < handler.slots.size(); screenSlot++) {
101
            var slot = handler.slots.get(screenSlot);
102
            if (slot == null || !slot.hasItem()) continue;
103
104
            if (!(slot.container instanceof net.minecraft.world.entity.player.Inventory inv)) continue;
105
            if (inv.player != mc.player) continue;
106
107
            int invIndex = slot.getContainerSlot();
108
            if (invIndex < 0 || invIndex >= 36) continue;
109
110
            var stack = slot.getItem();
111
            if (stack == null || stack.isEmpty()) continue;
112
113
            String id = BuiltInRegistries.ITEM.getKey(stack.getItem()).toString().toLowerCase();
114
            if (targets.contains(id)) {
115
                trashSlots.add(screenSlot);
116
            }
117
        }
118
119
        int allowed = Math.max(0, maxTrashSlotsValue.get());
120
        int over = trashSlots.size() - allowed;
121
        if (over <= 0) return;
122
123
        int perTick = Math.max(1, stacksPerTickValue.get());
124
        int toDrop = Math.min(perTick, over);
125
126
        for (int i = 0; i < toDrop; i++) {
127
            var slot = handler.slots.get(trashSlots.get(i));
128
129
            InventorySwap.INSTANCE.dropStack(slot);
130
131
        }
132
133
        cooldownTicks = Math.max(0, delayTicksValue.get());
134
    }
135
136
}
137