Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,25 @@ public class EntitySpeed extends Module {

private final Setting<Double> speed = sgGeneral.add(new DoubleSetting.Builder()
.name("speed")
.description("Movement speed in blocks per second.")
.description("Horizontal speed in blocks per second.")
.defaultValue(10)
.min(0)
.sliderMax(50)
.build()
);

private final Setting<Double> verticalSpeed = sgGeneral.add(new DoubleSetting.Builder()
.name("vertical-speed")
.description("Vertical speed in blocks per second for happy ghast.")
.defaultValue(5)
.min(0)
.sliderMax(50)
.build()
);

private final Setting<Boolean> onlyOnGround = sgGeneral.add(new BoolSetting.Builder()
.name("only-on-ground")
.description("Use speed only when standing on a block.")
.description("Use speed only when standing on a block. (excludes happy ghast)")
.defaultValue(false)
.build()
);
Expand All @@ -56,7 +65,7 @@ private void onLivingEntityMove(LivingEntityMoveEvent event) {

// Check for onlyOnGround and inWater
LivingEntity entity = event.entity;
if (onlyOnGround.get() && !entity.isOnGround()) return;
if (onlyOnGround.get() && !entity.isOnGround() && !(entity instanceof HappyGhastEntity)) return; // Bypass onlyOnGround for happy ghast
if (!inWater.get() && entity.isTouchingWater()) return;

// Set horizontal velocity
Expand All @@ -65,8 +74,8 @@ private void onLivingEntityMove(LivingEntityMoveEvent event) {

if (entity instanceof HappyGhastEntity) {
double velY = 0;
if (mc.options.jumpKey.isPressed()) velY += speed.get();
if (Input.isPressed(mc.options.sprintKey)) velY -= speed.get();
if (mc.options.jumpKey.isPressed()) velY += verticalSpeed.get();
if (Input.isPressed(mc.options.sprintKey)) velY -= verticalSpeed.get();

((IVec3d) event.movement).meteor$setY(velY / 20);
}
Expand Down