【Java】我的世界Java版外挂制作 [4] - 移动类模块合集

ROOT:挂端主文件夹

4x001 AutoWalk

AutoWalk顾名思义,就是自动走路,可以防止服务器因为AFK把你踢了。在movement包下创建一个新类,叫做AutoWalk,并在里面输入以下代码:

package me.hack.hackedclient.module.movement;

import me.hack.hackedclient.module.Category;
import me.hack.hackedclient.module.Module;

public class AutoWalk extends Module {
   

    public AutoWalk() {
   
        super("AutoWalk", 0, Category.MOVEMENT);
    }

    @Override
    public void onUpdate() {
   
        if(this.isToggled()) {
   
            mc.gameSettings.keyBindForward.pressed = true;
        }
        super.onUpdate();
    }

    @Override
    public void onDisable() {
   
        mc.gameSettings.keyBindForward.pressed = false;
        super.onDisable();
    }

}

这段代码很容易理解,就是在开启这个模块的时候,让我的世界以为你按下了前进键,关闭的时候就让我的世界以为你松开了前进键。
现在,在ModuleManagerMOVEMENT注释下添加:

newMod(new AutoWalk());

4x002 Dolphin

Dolphin就是可以让你在水里时自动向上移动,像海豚一样。在movement包下创建一个新类,叫Dolphin,并输入以下代码:

package me.hack.hackedclient.module.movement;

import me.hack.hackedclient.module.Category;
import me.hack.hackedclient.module.Module;

public class Dolphin extends Module {
   

    public Dolphin() {
   
        super("Dolphin", 0, Category.MOVEMENT);
    }

    @Override
    public void onUpdate() {
   
        if(this.isToggled()) {
   
            if(mc.thePlayer.isInWater()) {
   
                mc.thePlayer.motionY += 0.04;
            }
        }
        super.onUpdate();
    }

}

ModuleManagerMOVEMENT注释下添加:

newMod(new Dolphin());

4x003 Flight

就是可以让你飞起来,但是容易被ban。在movement包下创建一个新类,叫Flight并添加以下代码:

package me.hack.hackedclient.module.movement;

import me.hack.hackedclient.module.Category;
import me.hack.hackedclient.module.Module;

public class Flight extends Module {
   

    public static float flyHackSpeed = 0.1F;

    public Flight() {
   
        super("Flight", 0, Category.MOVEMENT);
    }

    @Override
    public void onDisable() {
   
        mc.thePlayer.capabilities.isFlying = false;
        super.onDisable();
    }

    @Override
    public void onUpdate() {
   
        if(this.isToggled()) {
   
            mc.thePlayer.capabilities.isFlying = true;

            if(mc.gameSettings.keyBindJump.isPressed()) {
   
                mc.thePlayer.motionY += 0.2F;
            }

            if(mc.gameSettings.keyBindSneak.isPressed()) {
   
                mc.thePlayer.motionY -= 0.2F;
            }

            if(mc.gameSettings.keyBindForward.isPressed()) {
   
                mc.thePlayer.capabilities.setFlySpeed(flyHackSpeed);
            }
        }
        super.onUpdate();
    }

}

ModuleManagerMOVEMENT注释下添加:

newMod(new Flight());

4x004 NoFall

让你免掉落伤害。在movement包下创建一个新类,叫NoFall并添加以下代码:

package me.hack.hackedclient.module.movement;

import me.hack.hackedclient.module.Category;
import me.hack.hackedclient.module.Module;
import net.minecraft.network.play.client.C03PacketPlayer;

public class NoFall extends Module {
   

    public NoFall() {
   
        super("NoFall", 0, Category.MOVEMENT);
    }

    @Override
    public void onUpdate() {
   
        if(this.isToggled()) {
   
            if(mc.thePlayer.fallDistance > 2F) {
   
                mc.thePlayer.sendQueue.addToSendQueue(new C03PacketPlayer(true));
            }
        }
        super.onUpdate();
    }

}

ModuleManagerMOVEMENT注释下添加:

newMod(new NoFall());

4x005 Glide

就是可以让你在掉落时滑翔。在movement包下创建一个新类,叫Glide并添加以下代码:

package me.hack.hackedclient.module.movement;

import me.hack.hackedclient.module.Category;
import me.hack.hackedclient.module.Module;
import net.minecraft.block.material.Material;

public class Glide extends Module {
   

    public Glide() {
   
        super("Glide", 0, Category.MOVEMENT);
    }

    @Override
    public void onUpdate() {
   
        double oldY = mc.thePlayer.motionY;
        float oldJ = mc.thePlayer.jumpMovementFactor;

        if(this.isToggled()) {
   
            if((mc.thePlayer.motionY < 0.0D)
                    && (mc.thePlayer.isAirBorne)
                    && (!mc.thePlayer.isInWater())
                    && (!mc.thePlayer.isOnLadder())
                    && (!mc.thePlayer.isInsideOfMaterial(Material.lava))) {
   
                mc.thePlayer.motionY = -.125D;
                mc.thePlayer.jumpMovementFactor *= 1.12337F;
            }
        } else {
   
            mc.thePlayer.motionY = oldY;
            mc.thePlayer.jumpMovementFactor = oldJ;
        }
        super.onUpdate();
    }

}

ModuleManagerMOVEMENT注释下添加:

newMod(new Glide());

4x006 Jetpack

让你在长按空格的时候可以飞起来。在movement包下创建一个新类,叫Jetpack并添加以下代码:

package me.hack.hackedclient.module.movement;

import me.hack.hackedclient.module.Category;
import me.hack.hackedclient.module.Module;

public class Jetpack extends Module {
   

    public Jetpack() {
   
        super("Jetpack", 0, Category.MOVEMENT);
    }

    @Override
    public void onUpdate() {
   
        if(this.isToggled()) {
   
            if(mc.gameSettings.keyBindJump.pressed) {
   
                mc.thePlayer.jump();
            }
        }
        super.onUpdate();
    }

}

ModuleManagerMOVEMENT注释下添加:

newMod(new Jetpack());

4x007 Parkour

让你自动在一个方块的边缘按空格来跳跃,对于跑酷来说非常有用。在movement包下创建一个新类,叫Parkour并添加以下代码:

package me.hack.hackedclient.module.movement;

import me.hack.hackedclient.module.Category;
import me.hack.hackedclient.module.Module;
import net.minecraft.entity.Entity;

public 
  • 3
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值