auto-mount module

auto-mount: Minecraft 26.3 cheat module, full source for every implementation (1 client: Meteor Client).

1 implementationWorld

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.

Meteor ClientWorldsrc/main/java/meteordevelopment/meteorclient/systems/modules/world/AutoMount.javaJava · 94 lines · 3.7 KB

Automatically mounts entities.

Settingscheck-saddlerotateentities
AutoMount.javaJava · Minecraft 26.2 · 94 lines · 3.7 KB · complete file, verbatimOriginal ↗
1
/*
2
 * This file is part of the Meteor Client distribution (https://github.com/MeteorDevelopment/meteor-client).
3
 * Copyright (c) Meteor Development.
4
 */
5
6
package meteordevelopment.meteorclient.systems.modules.world;
7
8
//Created by squidoodly 16/07/2020
9
10
import meteordevelopment.meteorclient.events.world.TickEvent;
11
import meteordevelopment.meteorclient.settings.BoolSetting;
12
import meteordevelopment.meteorclient.settings.EntityTypeListSetting;
13
import meteordevelopment.meteorclient.settings.Setting;
14
import meteordevelopment.meteorclient.settings.SettingGroup;
15
import meteordevelopment.meteorclient.systems.modules.Categories;
16
import meteordevelopment.meteorclient.systems.modules.Module;
17
import meteordevelopment.meteorclient.utils.entity.EntityUtils;
18
import meteordevelopment.meteorclient.utils.player.PlayerUtils;
19
import meteordevelopment.meteorclient.utils.player.Rotations;
20
import meteordevelopment.orbit.EventHandler;
21
import net.minecraft.world.InteractionHand;
22
import net.minecraft.world.entity.Entity;
23
import net.minecraft.world.entity.EntityType;
24
import net.minecraft.world.entity.Mob;
25
import net.minecraft.world.entity.animal.equine.Llama;
26
import net.minecraft.world.entity.animal.equine.SkeletonHorse;
27
import net.minecraft.world.entity.animal.equine.ZombieHorse;
28
import net.minecraft.world.entity.animal.pig.Pig;
29
import net.minecraft.world.entity.monster.Strider;
30
import net.minecraft.world.item.SpawnEggItem;
31
import net.minecraft.world.phys.EntityHitResult;
32
33
import java.util.Set;
34
35
public class AutoMount extends Module {
36
    private final SettingGroup sgGeneral = settings.getDefaultGroup();
37
38
    private final Setting<Boolean> checkSaddle = sgGeneral.add(new BoolSetting.Builder()
39
        .name("check-saddle")
40
        .description("Checks if the entity contains a saddle before mounting.")
41
        .defaultValue(false)
42
        .build()
43
    );
44
45
    private final Setting<Boolean> rotate = sgGeneral.add(new BoolSetting.Builder()
46
        .name("rotate")
47
        .description("Faces the entity you mount.")
48
        .defaultValue(true)
49
        .build()
50
    );
51
52
    private final Setting<Set<EntityType<?>>> entities = sgGeneral.add(new EntityTypeListSetting.Builder()
53
        .name("entities")
54
        .description("Rideable entities.")
55
        .filter(EntityUtils::isRideable)
56
        .build()
57
    );
58
59
    public AutoMount() {
60
        super(Categories.World, "auto-mount", "Automatically mounts entities.");
61
    }
62
63
    @EventHandler
64
    private void onTick(TickEvent.Pre event) {
65
        if (mc.player.isPassenger()) return;
66
        if (mc.player.isShiftKeyDown()) return;
67
        if (mc.player.getMainHandItem().getItem() instanceof SpawnEggItem) return;
68
69
        for (Entity entity : mc.level.entitiesForRendering()) {
70
            if (!entities.get().contains(entity.getType())) continue;
71
            if (!PlayerUtils.isWithin(entity, 4)) continue;
72
            if ((entity instanceof Pig || entity instanceof SkeletonHorse || entity instanceof Strider || entity instanceof ZombieHorse) && !((Mob) entity).isSaddled())
73
                continue;
74
            if (!(entity instanceof Llama) && entity instanceof Mob mobEntity && checkSaddle.get() && !mobEntity.isSaddled())
75
                continue;
76
            interact(entity, rotate.get());
77
            return;
78
        }
79
    }
80
81
    private void interact(Entity entity, boolean rotate) {
82
        if (rotate) {
83
            Rotations.rotate(Rotations.getYaw(entity), Rotations.getPitch(entity), -100, () -> interact(entity));
84
        } else {
85
            interact(entity);
86
        }
87
    }
88
89
    private void interact(Entity entity) {
90
        EntityHitResult location = new EntityHitResult(entity, entity.getBoundingBox().getCenter());
91
        mc.gameMode.interact(mc.player, entity, location, InteractionHand.MAIN_HAND);
92
    }
93
}
94