Skip to content
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

Old hurt animation #778

Open
nichady opened this issue Jan 1, 2025 · 1 comment
Open

Old hurt animation #778

nichady opened this issue Jan 1, 2025 · 1 comment
Labels
enhancement A feature or enhancement suggestion for OldCombatMechanics

Comments

@nichady
Copy link

nichady commented Jan 1, 2025

Problem

Minecraft 1.19.4 slightly changed the way the hurt animation works when you take damage. 1.19.4 includes a "Yaw" parameter, which slightly changes the way the hurt animation looks. For example, if you punch a player from the left side, the hurt animation from their perspective will look slightly different than if you punched from the right. Before 1.19.4, all hurt animations would look the same.

This can be seen on the wiki page for the Minecraft protocol:
The 1.19.3 protocol would send an "entity animation" packet (link) while the 1.19.4 protocol sends a "hurt animation" packet which includes a "Yaw" parameter (link).

Proposed solution

ProtocolLib could be used to intercept all "hurt animation" packets and then make them look like the old animation. After doing some testing, it seems that the old animation can be achieved by setting the Yaw value to 0 every time.

Alternative solutions

This maybe could also be done without ProtocolLib by using because Spigot/Paper exposes the methods LivingEntity.playHurtAnimation() and Player.sendHurtAnimation(). Another thing to note is that, after playing around with these methods, I noticed that the Yaw value is displaced by 90 degrees when the packet is actually sent. So, when calling playHurtAnimation(10f), the actual packet would give a Yaw value of 100. So to get the old behavior, you need to do playHurtAnimation(-90f).

@nichady nichady added the enhancement A feature or enhancement suggestion for OldCombatMechanics label Jan 1, 2025
@kernitus
Copy link
Owner

kernitus commented Jan 3, 2025

That's interesting, but how does this affect combat itself in any way?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement A feature or enhancement suggestion for OldCombatMechanics
Projects
None yet
Development

No branches or pull requests

2 participants