TogAr2 / MinestomPvP

PvP extension for Minestom
Apache License 2.0
69 stars 30 forks source link

Knockback in water no less #26

Open AutoComplete1 opened 1 year ago

AutoComplete1 commented 1 year ago

Players get exactly the same knockback in water as if the water is not there. In Vanilla the player gets less knockback in the water

TogAr2 commented 2 months ago

Did you test this with actual players (and not just fakeplayers or any other entity whose movement is controlled server side)? Minestom physics does not have support for water, which would explain the issue

TogAr2 commented 2 months ago

I did some testing today and it seems the knockback in water should be different because the gravity & physics in water is different, but this is not the case in Minestom. Am I right to assume there is no difference for strong (while sprinting) attacks in water? There shouldn't be because the velocity is sent instantly for those

TogAr2 commented 2 months ago

Implementing water physics is going to be quite difficult and out of scope for this project, even though I do think Minestom should support them. I'll try to incorporate some of it in MinestomFluids

emortaldev commented 2 months ago

water physics will be handled on the client, I think you should just check if the player landed on slime blocks or hay bales, then check if the player landed in water or a ladder/vine this is how I did it on my fork of minestompvp (now gone)

TogAr2 commented 2 months ago

water physics will be handled on the client

The problem is that this is not completely the case. The vanilla server applies a physics tick before sending the velocity out to the player, which I replicated in MinestomPvP.

I am unaware (and also can't find in the vanilla source) of any differences in the knockback applied when the player is in water or on slime blocks, hay bales, beds.

I will solve this problem by eventually adding support for water physics, though it's not a high priority.

emortaldev commented 2 months ago

oh, my bad, i thought this was about fall damage :skull:

I will create another issue