blob: a1af3a7ac2c7989a483c26a9460665beb547cac2 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
package com.arslaancodes.arslaansmagichax.modules.impl;
import com.arslaancodes.arslaansmagichax.modules.Category;
import com.arslaancodes.arslaansmagichax.modules.Module;
import com.arslaancodes.arslaansmagichax.modules.settings.NumberSetting;
import net.minecraft.network.chat.Component;
import net.minecraft.world.phys.Vec3;
public class Jetpack extends Module {
private NumberSetting speed = new NumberSetting("Thrust Speed", 1, 10, 1, 1);
public Jetpack() {
super("Jetpack", "Turns your jump key into a jetpack.", -1, Category.MOVEMENT);
addSetting(speed);
}
@Override
protected void onEnable() {
if (mc.player == null) return;
mc.player.sendSystemMessage(Component.literal("[Jetpack] It is recommended to use this hack in combination with NoFall."));
}
@Override
public void tick() {
if (!this.isEnabled() || mc.player == null) return;
if (mc.options.keyJump.isDown()) {
mc.player.setDeltaMovement(new Vec3(mc.player.getDeltaMovement().x, 0.42 * speed.getValue(), mc.player.getDeltaMovement().z));
mc.player.fallDistance = 0;
}
}
}
|