Skip to content
11 changes: 11 additions & 0 deletions src/main/java/net/wurstclient/hacks/AimAssistHack.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,11 @@ public final class AimAssistHack extends Hack
private final CheckboxSetting checkLOS = new CheckboxSetting(
"Check line of sight", "Won't aim at entities behind blocks.", true);

private final CheckboxSetting aimWhileBlocking = new CheckboxSetting(
"Aim while blocking", "Keeps aiming at entities while you're blocking"
+ " with a shield or using items.",
false);

private final EntityFilterList entityFilters =
new EntityFilterList(FilterPlayersSetting.genericCombat(false),
FilterSleepingSetting.genericCombat(false),
Expand Down Expand Up @@ -90,6 +95,7 @@ public AimAssistHack()
addSetting(rotationSpeed);
addSetting(fov);
addSetting(checkLOS);
addSetting(aimWhileBlocking);

entityFilters.forEach(this::addSetting);
}
Expand Down Expand Up @@ -123,10 +129,15 @@ protected void onDisable()
@Override
public void onUpdate()
{
target = null;

// don't aim when a container/inventory screen is open
if(MC.currentScreen instanceof HandledScreen)
return;

if(!aimWhileBlocking.isChecked() && MC.player.isUsingItem())
return;

Stream<Entity> stream = EntityUtils.getAttackableEntities();
double rangeSq = Math.pow(range.getValue(), 2);
stream = stream.filter(e -> MC.player.squaredDistanceTo(e) <= rangeSq);
Expand Down
12 changes: 7 additions & 5 deletions src/main/java/net/wurstclient/hacks/TriggerBotHack.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,11 @@ public final class TriggerBotHack extends Hack implements UpdateListener
"How TriggerBot should swing your hand when attacking.",
SwingHand.CLIENT);

private final CheckboxSetting attackWhileBlocking = new CheckboxSetting(
"Attack while blocking",
"Whether or not to attack while blocking with a shield / using items.",
false);
private final CheckboxSetting attackWhileBlocking =
new CheckboxSetting("Attack while blocking",
"Attacks even while you're blocking with a shield or using items."
+ " This would not be possible in vanilla.",
false);

private final EntityFilterList entityFilters =
EntityFilterList.genericCombat();
Expand All @@ -55,6 +56,7 @@ public TriggerBotHack()
addSetting(speed);
addSetting(swingHand);
addSetting(attackWhileBlocking);

entityFilters.forEach(this::addSetting);
}

Expand Down Expand Up @@ -93,7 +95,7 @@ public void onUpdate()
return;

ClientPlayerEntity player = MC.player;
if(player.isUsingItem() && !attackWhileBlocking.isChecked())
if(!attackWhileBlocking.isChecked() && player.isUsingItem())
return;

if(MC.crosshairTarget == null
Expand Down