garbagemule / MobArena

MobArena plugin for Minecraft
GNU General Public License v3.0
189 stars 150 forks source link

Velocity related boss skills sometimes instakill players #757

Open fireheart3911 opened 1 year ago

fireheart3911 commented 1 year ago

Bug report

Short description

Velocity related boss skills (in my case pull-all and throw-nearby) sometimes instakill players

Reproduction steps

  1. Have a boss with said abilities and a low ability cooldown
  2. Run away from the boss
  3. Randomly die (Player hit the ground to hard)

Details

Additional info

fireheart3911 commented 1 year ago

Seems like i am unable to read... Duplicate of #755

garbagemule commented 1 year ago

I'm reopening here because this issue follows the template and has a more precise title.

For reference: throw-nearby ability code

All of the throw abilities use the same logic: calculate the direction vector from the boss towards the player on the XZ-plane, normalize it, and then set a fixed Y-value of 0.8. The idea is that the direction becomes "up and away" from the player's current location. The pull abilities work on a similar basis, although with a bit of scaling sprinkled in right after normalizing but before setting the fixed Y-value (the reasoning is lost to time as the code is old and my commit messages were useless back then).

I don't have much of a clue about what could be causing the issue. If the death message is that they "hit the ground too hard", it's most likely because the change to player velocity causes some sort of "slamming". That is, the server thinks that the player has fallen instead of being launched up in the air, perhaps due to some sort of clipping issues where the player is technically "under" the block they are standing on, and that's causing the velocity to drive them "into" the block for fall damage..?

Can we gather some more details about the context in which players are dying to this glitch?

I could perhaps make a build that sets the player fall distance to 0 prior to setting the velocity, or one that teleports the player up by half a block in the same tick, but it's very much fumbling in the dark, especially because it's an intermittent glitch rather than a reproducible bug. Alternatively, I could add some log statements to the player location and velocity and perhaps some other available data points, maybe both during the ability execution and the player death event. Or maybe both. Either way, I'd need some help trying it out for a while, since I don't run a server and I can't reproduce the issue myself. If you (@fireheart3911) and/or @Drizzt11 would be interested in that, hop on Discord and I'll try to whip something up for you to try.

fireheart3911 commented 1 year ago

death can be seen here: https://youtu.be/1skd11WXXsA?t=554