-
-
Notifications
You must be signed in to change notification settings - Fork 923
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
updating activateItem #3445
updating activateItem #3445
Conversation
lib/plugins/inventory.js
Outdated
@@ -122,17 +124,26 @@ function inject (bot, { hideErrors }) { | |||
}) | |||
} else if (bot.supportFeature('useItemWithOwnPacket')) { | |||
bot._client.write('use_item', { | |||
hand: offHand ? 1 : 0 | |||
hand: offHand ? 1 : 0, | |||
sequence: ++sequence |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this always increment? Can you put this increment operation up top as opposed to inside the packet body?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What I mean by moving it upward is moving it out of the feature check and keeping it as a proper internal counter. |
Oh! I'm not sure earlier versions have, hence why I put in a feature check. I can just move the sequence increment itself. |
|
||
if (bot.supportFeature('useItemWithOwnPacket')) { | ||
body.face = 0 | ||
body.sequence = 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note, you can supply extra fields on packets without any problems. If the field is not used on a particular version it will be ignored. I'm curious why the sequence
is always 0 here, is it being reset or just fixed to 0?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is just fixed to zero. I have no idea to be honest. It doesn't change the sequence count.
I decided to add a feature support there since I wasn't sure if the face affected anything and just wanted to be as legitimate as possible without disrupting the original face (5)'s implementation.
bot.activateItem
andbot.deactivateItem
both fail on new version of anticheat due to not specifying the sequence.For using a bow:
For eating (duplicate use_item due to immediately attempting to eat the next food)
For using a shield:
I do not believe there are any breaking changes.