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/Ghost.javaJava · 44 lines · 1.3 KB
| 1 | package thunder.hack.features.modules.misc;
|
| 2 |
|
| 3 | import meteordevelopment.orbit.EventHandler;
|
| 4 | import net.minecraft.network.protocol.game.ServerboundMovePlayerPacket;
|
| 5 | import thunder.hack.events.impl.PacketEvent;
|
| 6 | import thunder.hack.features.modules.Module;
|
| 7 |
|
| 8 | import static thunder.hack.features.modules.client.ClientSettings.isRu;
|
| 9 |
|
| 10 | public class Ghost extends Module {
|
| 11 | public Ghost() {
|
| 12 | super("Ghost", Category.MISC);
|
| 13 | }
|
| 14 |
|
| 15 | private boolean bypass = false;
|
| 16 |
|
| 17 | @Override
|
| 18 | public void onEnable() {
|
| 19 | bypass = false;
|
| 20 | }
|
| 21 |
|
| 22 | @Override
|
| 23 | public void onDisable() {
|
| 24 | if (mc.player != null) mc.player.respawn();
|
| 25 | bypass = false;
|
| 26 | }
|
| 27 |
|
| 28 | @Override
|
| 29 | public void onUpdate() {
|
| 30 | if (mc.player == null || mc.level == null) return;
|
| 31 | if (mc.player.getHealth() == 0.0f) {
|
| 32 | mc.player.setHealth(20.0f);
|
| 33 | bypass = true;
|
| 34 | mc.gui.setScreen(null);
|
| 35 | mc.player.setPos(mc.player.getX(), mc.player.getY(), mc.player.getZ());
|
| 36 | sendMessage(isRu() ? "Для возрождения выключи модуль!" : "To revive, turn off the module!");
|
| 37 | }
|
| 38 | }
|
| 39 |
|
| 40 | @EventHandler
|
| 41 | public void onPacketSend(PacketEvent.Send event) {
|
| 42 | if (bypass && event.getPacket() instanceof ServerboundMovePlayerPacket) event.cancel();
|
| 43 | }
|
| 44 | }
|
Mixins (1)
IPlayerMoveC2SPacket.javaJava · 17 lines · 470 B
@Mixin(ServerboundMovePlayerPacket.class)
| 1 | package thunder.hack.injection.accesors;
|
| 2 |
|
| 3 | import net.minecraft.network.protocol.game.ServerboundMovePlayerPacket;
|
| 4 | import org.spongepowered.asm.mixin.Mixin;
|
| 5 | import org.spongepowered.asm.mixin.Mutable;
|
| 6 | import org.spongepowered.asm.mixin.gen.Accessor;
|
| 7 |
|
| 8 | @Mixin(ServerboundMovePlayerPacket.class)
|
| 9 | public interface IPlayerMoveC2SPacket {
|
| 10 | @Mutable
|
| 11 | @Accessor("onGround")
|
| 12 | void setOnGround(boolean onGround);
|
| 13 |
|
| 14 | @Mutable
|
| 15 | @Accessor("y")
|
| 16 | void setY(double y);
|
| 17 | }
|