PrismarineJS / mineflayer

Create Minecraft bots with a powerful, stable, and high level JavaScript API.
https://prismarinejs.github.io/mineflayer/
MIT License
4.96k stars 904 forks source link

Bots don't deal full-charged damage when pvp-ing. #2371

Closed Hedgie1 closed 2 years ago

Hedgie1 commented 2 years ago

Versions

Detailed description of a problem

I am developing a bot with lot of functions, pvp too. PVP was working great until I installed the new version of mineflayer because of the SkinsRestorer fix.

When I start PVP mode now, the bot will hit me but is dealing very low damage, because he doesn't do full-charged hit.

Expected behavior

Bot should deal full-charged hits.

Additional context

Sorry for my bad english :D

rom1504 commented 2 years ago

Do you mean https://github.com/PrismarineJS/mineflayer/pull/2302 ? Any idea @U5B ?

rom1504 commented 2 years ago

https://github.com/PrismarineJS/mineflayer/blob/master/docs/history.md among those recent changes I'd say Fixed wrong arm swinging (@IceTank) And Send arm_animation before use_entity (@aesthetic0001)

Might be related with your issue

nickelpro commented 2 years ago

I don't think we ever accounted for swing cooldown (which is what I assume this is about) when swinging.

You would have to build the cooldown into your own PvP plugin, mineflayer has no concept of it

Hedgie1 commented 2 years ago

I am using mineflayer-pvp plugin, it worked fine but after new mineflayer update it deals lower damage because the swing animation is called twice I think.

U5B commented 2 years ago

You should make sure that the item you are using is listed here and is the correct attack speed. https://github.com/PrismarineJS/mineflayer-pvp/blob/c54135944268521c6dc76a92f1bf8c8be5ae7fc2/src/AttackSpeeds.json I believe this issue should be moved to mineflayer-pvp.

Hedgie1 commented 2 years ago

Yeah, it's correct. As I said before, it was working fine until new mineflayer update (not mineflayer-pvp).

I think it may be related to @rom1504 's comment. (Fixed wrong arm swinging / Send arm_animation before use_entity)

Hedgie1 commented 2 years ago

The bug is caused by "Send arm_animation before use_entity" patch.

rom1504 commented 2 years ago

ok so the next step would be identifying the right behavior for this, https://github.com/Heath123/pakkit can help

rom1504 commented 2 years ago

Should be fixed now, try to update to 3.14.1

aesthetic0001 commented 2 years ago

Should prob be closed