Skip to content

Commit

Permalink
fix: when left click was pressed down the swing arm packet sending wa…
Browse files Browse the repository at this point in the history
…s not limited
  • Loading branch information
zardoy committed Aug 31, 2024
1 parent eb0bc02 commit bbd01d9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/worldInteractions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ class WorldInteraction {
currentDigTime
prevOnGround
lastBlockPlaced: number
lastSwing = 0
buttons = [false, false, false]
lastButtons = [false, false, false]
breakStartTime: number | undefined = 0
Expand Down Expand Up @@ -350,8 +351,9 @@ class WorldInteraction {
})
customEvents.emit('digStart')
this.lastDigged = Date.now()
} else {
} else if (performance.now() - this.lastSwing > 200) {
bot.swingArm('right')
this.lastSwing = performance.now()
}
}
this.prevOnGround = onGround
Expand Down

0 comments on commit bbd01d9

Please sign in to comment.