AutoEject module

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

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.

NicotinePlayersrc/client/java/nicotine/mod/mods/player/AutoEject.javaJava · 53 lines · 1.4 KB

Throws away junk items from your inventory

SettingsItems
AutoEject.javaJava · Minecraft 26.3 · 53 lines · 1.4 KB · complete file, verbatimOriginal ↗
1
package nicotine.mod.mods.player;
2
3
import net.minecraft.world.item.Items;
4
import nicotine.events.ClientLevelTickEvent;
5
import nicotine.mod.Mod;
6
import nicotine.mod.ModCategory;
7
import nicotine.mod.option.ItemSelectionOption;
8
import nicotine.util.EventBus;
9
import nicotine.util.Inventory;
10
11
import java.util.Arrays;
12
13
import static nicotine.util.Common.mc;
14
15
public class AutoEject extends Mod {
16
17
    private final ItemSelectionOption junk = new ItemSelectionOption("Items");
18
19
    public AutoEject() {
20
        super(ModCategory.Player, "AutoEject", "Throws away junk items from your inventory");
21
22
        junk.items.addAll(Arrays.asList(
23
                Items.DIRT,
24
                Items.COBBLESTONE,
25
                Items.COBBLED_DEEPSLATE,
26
                Items.NETHERRACK,
27
                Items.ANDESITE,
28
                Items.DIORITE,
29
                Items.GRANITE,
30
                Items.ROTTEN_FLESH
31
        ));
32
33
        this.addOptions(junk);
34
    }
35
36
    @Override
37
    protected void init() {
38
        EventBus.register(ClientLevelTickEvent.class, event -> {
39
            if (!this.enabled)
40
                return true;
41
42
            for (int i = 0; i <= 35; i++) {
43
                if (junk.items.contains(mc.player.getInventory().getItem(i).getItem())) {
44
                    Inventory.throwAway(i < 9 ? 36 + i : i);
45
                }
46
            }
47
48
            return true;
49
        });
50
51
    }
52
}
53