Skip to content

Commit

Permalink
use bunny jump
Browse files Browse the repository at this point in the history
  • Loading branch information
Christopher committed May 10, 2024
1 parent d99d4d3 commit f89291c
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/client/java/dev/clatza/mcautofight/MovementHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,22 @@ public static void registerGameEvents(){
return;
}
});

ClientTickEvents.END_CLIENT_TICK.register(client -> {
PlayerEntity player = MinecraftClient.getInstance().player;

if (!GlobalData.isAttacking) return;
if (GlobalData.currentTargetEntity == null) return;
if (MinecraftClient.getInstance().player == null) return;

double distance = player.distanceTo(GlobalData.currentTargetEntity);

if(distance >= 5.0){
KeyBindingHelper.setKeyBindingPressed(MinecraftClient.getInstance().options.jumpKey, true);
}else{
KeyBindingHelper.setKeyBindingPressed(MinecraftClient.getInstance().options.jumpKey, false);
}
});
}

public static void attackEntity(Entity entity) {
Expand Down

0 comments on commit f89291c

Please sign in to comment.