BG-Software-LLC / WildStacker

Stacked drops, stacked entities, stacked blocks and stacked spawners in one plugin!
https://bg-software.com/wildstacker/
GNU General Public License v3.0
90 stars 36 forks source link

Fixing knockback with one-shot feature #85

Open SpinKnight opened 3 years ago

SpinKnight commented 3 years ago

The one-shot feature has been very nice. But it would be lovely to see a fix for the mobs taking knockback, if you hit them too fast.

A potential fix would be waiting 1 tick, then setting their velocity to 0: https://bukkit.org/threads/remove-knock-back.145054/

Issue: https://gyazo.com/084cba0b6a038943cfe643daec429076

OmerBenGera commented 3 years ago

Latest dev build already fixes it, and if it doesn't - then it might be an issue with the spigot jar you're using. Setting the velocity to 0 isn't really a good fix.

YouSeeMeRunning2 commented 3 years ago

I've tested the latest developer build with tunity 1.16 and I didn't see any change

SpinKnight commented 3 years ago

I've tested the latest developer build with tunity 1.16 and I didn't see any change

Same. The clip in the video was on the latest dev build and with regular paper 1.8.8.

SpinKnight commented 3 years ago

Latest dev build already fixes it, and if it doesn't - then it might be an issue with the spigot jar you're using. Setting the velocity to 0 isn't really a good fix.

Fair enough, if you don't think it's a "good fix". Is it because of performance? Anyway, there is a fix for it, clearly, so it would be lovely to get this problem fixed.

OmerBenGera commented 3 years ago

Send me your entire config file please, so I can try and replicate the issue.

SpinKnight commented 3 years ago

Keep in mind, it's if you hit "too fast". So try and click like a decent 8+ CPS to replicate it.

WildStacker.zip

OmerBenGera commented 3 years ago

Upload the config contents to pastebin.

YouSeeMeRunning2 commented 3 years ago

https://pastebin.com/gX8rggJx

SpinKnight commented 3 years ago

https://pastebin.com/s3H0s27b

OmerBenGera commented 3 years ago

https://pastebin.com/gX8rggJx

You have one shot disabled, therefore 50%+ of the hits don't kill the entities, therefore they take knockback.

https://pastebin.com/s3H0s27b

Gonna check the issue on 1.8 using your config

OmerBenGera commented 3 years ago

@SpinKnight Seems to only occurred when killing fast enough, therefore I implemented the velocity patch. Let me know if fixes the issue for you as well :)

SpinKnight commented 3 years ago

@SpinKnight Seems to only occurred when killing fast enough, therefore I implemented the velocity patch. Let me know if fixes the issue for you as well :)

Thanks. Will test now and let you know.

SpinKnight commented 3 years ago

It does not seem to work as intended with just WildStacker. Although when implementing my own listener that does the following: Bukkit.getScheduler().scheduleSyncDelayedTask(plugin, () -> event.getEntity().setVelocity(new Vector()),1L); in the EntityDamageEvent, it seems to work just fine.

WildStacker 3.5.1 b92: https://gyazo.com/bc41d117158f469c1fa3021c010f101f

OmerBenGera commented 3 years ago

It does not seem to work as intended with just WildStacker. Although when implementing my own listener that does the following: Bukkit.getScheduler().scheduleSyncDelayedTask(plugin, () -> event.getEntity().setVelocity(new Vector()),1L); in the EntityDamageEvent, it seems to work just fine.

WildStacker 3.5.1 b92: https://gyazo.com/bc41d117158f469c1fa3021c010f101f

Already done that...

SpinKnight commented 3 years ago

It does not seem to work as intended with just WildStacker. Although when implementing my own listener that does the following: Bukkit.getScheduler().scheduleSyncDelayedTask(plugin, () -> event.getEntity().setVelocity(new Vector()),1L); in the EntityDamageEvent, it seems to work just fine. WildStacker 3.5.1 b92: https://gyazo.com/bc41d117158f469c1fa3021c010f101f

Already done that...

Well no idea man. I can only give you my test results. Which is why I'm saying, if I do it myself, it does work -- because you told me you already implemented it, which seems odd.

OmerBenGera commented 3 years ago

It does not seem to work as intended with just WildStacker. Although when implementing my own listener that does the following: Bukkit.getScheduler().scheduleSyncDelayedTask(plugin, () -> event.getEntity().setVelocity(new Vector()),1L); in the EntityDamageEvent, it seems to work just fine. WildStacker 3.5.1 b92: https://gyazo.com/bc41d117158f469c1fa3021c010f101f

Already done that...

Well no idea man. I can only give you my test results.

I will test it again, as for me the jar fixed the issue...

OmerBenGera commented 3 years ago

Btw I am using an auto clicker so I can easily get 10cps, might be due to that

SpinKnight commented 3 years ago

Btw I am using an auto clicker so I can easily get 10cps, might be due to that

I, too, was using an auto clicker in that clip. Getting around around 40-50 cps, but also tried with regular jitter-clicking (11 cps), where it also did not seem to work

OmerBenGera commented 3 years ago

I will try to increase the delay, maybe it helps... idk Btw, does it work for you if you listen to EntityDamageByEntityEvent?

OmerBenGera commented 3 years ago

Btw, I cancel the event which in theory should already fix the knockback, I am not sure why it doesnt in first place...

SpinKnight commented 3 years ago

Btw, does it work for you if you listen to EntityDamageByEntityEvent?

Yeah, it does.

SpinKnight commented 3 years ago

Btw, I cancel the event which in theory should already fix the knockback, I am not sure why it doesnt in first place...

Idk. Perhaps since if it's if you do it too fast, maybe it's because you're hitting it before some properties are set or smth? No idea.

SpinKnight commented 3 years ago

I did a little more testing. It seems to be a problem with TacoSpigot. Unless you plan on supporting Taco, I guess you can close this issue, since it works flawlessly on Spigot/Paper 1.8.8.

OmerBenGera commented 3 years ago

I did a little more testing. It seems to be a problem with TacoSpigot. Unless you plan on supporting Taco, I guess you can close this issue, since it works flawlessly on Spigot/Paper 1.8.8.

Weird, I used taco for 1.8.8 lol

SpinKnight commented 3 years ago

Huh, weird, works fine for me on Paper

OmerBenGera commented 3 years ago

This whole situation is just weird. However, because most of the 1.8.8 forks are based on Taco and not on Paper, I am keeping this opened until we find a fix

SpinKnight commented 3 years ago

Alright. Sounds good. I also tested the above with no plugins, but WildStacker & Taco and it still seems to be an issue.

OmerBenGera commented 3 years ago

Alright. Sounds good. I also tested the above with no plugins, but WildStacker & Taco and it still seems to be an issue.

Maybe increasing the delay to 2 or will fix the issue, who knows

OmerBenGera commented 3 years ago

Try disabling corpses for a moment, I think it fixes the issue.

SpinKnight commented 3 years ago

Same behaviour for me.

OmerBenGera commented 3 years ago

Make sure you're not using build 93, but 92

OmerBenGera commented 3 years ago

It seems to be something with how laggy the server is in my opinion. When I see lag spikes, the mob has more chance to get knockback, but when the TPS is solid 20, it doesn't move at all

SpinKnight commented 3 years ago

I did not even notice there was a build 93, so I'm still on 92. My TPS is also straight up 20.0

OmerBenGera commented 3 years ago

As of now, I am marking this issue with "No known solution", as I can't seem to find the cause for it. I could replicate the issue, but I really don't know why it doesn't work..

SpinKnight commented 3 years ago

Alright. Yeah, it's quite a weird issue.