-
-
Notifications
You must be signed in to change notification settings - Fork 859
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
Velocity of other entities don't get updated correctly #3289
Comments
mineflayer/lib/plugins/entities.js Line 272 in 298d442
Idk if there are other packets or if the client is supposed to run the physics based on previous positions |
I did some looking into this and entities are updated via rel_entity_move, which provides the positional data and not velocity iirc. |
And also stable api does not fire any event in this case so it's unclear how to get an event of updating the velocity |
So sounds like mineflayer would need to recompute the velocity if you want
it to be continuously updated
…On Mon, Jan 22, 2024, 2:18 PM Vitaly ***@***.***> wrote:
entities are updated via rel_entity_move, which provides the positional
data and not velocity
And also stable api does not fire any event in this case so it's unclear
how to get an event of updating the velocity
—
Reply to this email directly, view it on GitHub
<#3289 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAR437UVATEIVGGXTCGYRJDYPZRLBAVCNFSM6AAAAABCFCGHECVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMBTHE4TAMJWHA>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
That isn't completely true: mineflayer/lib/plugins/entities.js Line 288 in 298d442
|
Sorry I didn't notice that question was for me. I wanted it to use to display entities with different colors based on its velocity (like idle, walking or sprinting) on minimap. |
To my knowledge, and I have tried pretty extensively at doing what you described (see https://github.com/nxg-org/mineflayer-tracker), it is impossible to get an accurate velocity of entities server side without interpolation that would constantly need to be corrected. (Namely for players, their yaw/pitch cannot be predicted). You can use the average positional changes you receive from If you have questions about the code I linked (as it has no README), I can explain what I do to predict probable velocities of entities given in the discord. |
I forgot to say that I've successfully integrated your module but it allows you only to get the approximate velocity and still don't understand how to get the state of the player (e.g. walking, sprinting and so on) |
Versions
Detailed description of a problem
Velocity of other entities don't get updated in some cases. For example if you push another player the
bot.entities["id"].velocity.z
or x won't be 0 even if it stays on the same place. However bot.entity.velocity does always seem to work correctly. Is this a known limitation?The text was updated successfully, but these errors were encountered: