Bug: Swimming XP configs / awards acting sus.
Silvertide7 opened this issue ยท 3 comments
Describe the bug
It seems that there are a few oddities with swimming xp being awarded that I think worked differently before. Right now while underwater you constantly receive XP regardless of if you are moving. This seems to be the SUBMERGED
xp award. So I set this to 0.0 because that is easily abused. When I do that I now receive no XP for swimming horizontally underwater, even while swim sprinting.
XP for DIVING
and SURFACING
are very interesting. I set DIVING
to 200.0, and SURFACING
to 2000.0. When I start at the bottom of the water and jump upward to surface, I am granted a ton of xp immediately, around 380. Then as I continue to ascend it only grants me 5 XP per award tick, the same as what it appears it is giving me for the DIVING
xp award tick as well. When I start at the top of the water and dive down, I am granted 5 xp every award tick. It seems like the initial xp award is using the configs and then it seems to be just giving 5 xp per tick regardless of if I am swimming up or down.
However it seems to fix itself when I start swim sprinting even though I have SWIM_SPRINTING
xp set to 0.0. Now the award for surfacing is what I'd expect it to be for 2000.0, and the award for diving is roughly 10x less, as it should be (200.0).
Another large thing I noticed, you gain DIVING
xp while inside a magma bubble stream, even when there is no movement in the Y direction. Since this replenishes your air as well, you can stand there infinitely to gain swimming xp. I'm not sure why it's granting xp as I thought only delta movement downward would grant it, not being sucked down against the bottom. Sitting on top of a soul sand column also awards xp infinitely. I can't think of an obvious way to fix this as it seems to be simulating SWIMMING
xp award. I am leaning towards only granting xp for swim sprinting to combat this, but as it doesn't grant xp while swimming horizontally it's not the best option either.
^ This seems to be handled well with anti cheese.
Expected behavior
Surfacing and Diving should give xp properly based on movement in the Y direction and the xp settings in the config. Swim Sprinting should grant XP while swimming horizontally even if SUBMERGED
is set to 0.0.
To Reproduce
Steps to reproduce the behavior:
Start a new world with just the latest PMMO installed. Tweak the configs as I do above and test out swimming with different values.
Versions:
- Minecraft: 1.20.1
- Loader: 47.2.6
- PMMO: 1.20.1-1.2.17
SWIMMING specifically refers to swimming across the surface of the water but not submerged. SUBMERGED is the generic underwater swimming XP.
it depends on what you have configured in your anti-cheese. Most of the abuse examples in your GH issue are either caused by or can be fixed with anti-cheese
@Caltinor I do still think there are some bugs going on with swimming. I explained a couple other tests I did where the behavior seems to be not working correctly. Maybe it's better as a feature request and it's working as intended though? I crossed out the part that dealt with the anti cheese you mentioned, but I think the rest I still not functioning correctly. Maybe I need to reword it to be more clear about what's wrong though, if so let me know!
Mainly I am getting the same amount of xp awarded per xp tick when surfacing and diving even though diving was set to 10x the xp of surfacing. When swim sprinting the xp award seems to be correct though.
Also I disabled submerged xp because I didn't want a constant xp stream just for sitting underwater, I wanted it to be based on movement instead. Doing this makes it so swimming or swim sprinting horizontally gives no xp though, you only gain xp when surfacing or diving.