Page 1 of 1

[Mod] Another knockback mod [knockback]

Posted: Wed May 29, 2019 16:04
by Lone_Wolf
Another knockback mod

A knockback mod for pre-5.1 Minetest clients that uses RayCast() and move_to() to fling the player backwards. No entities are used

Downloads: Latest Stable

View: On ContentDB
View: Source Code

License: MIT

Depends: None
Optional Depends: None

A few test players were harmed a couple hundred times during the making of this mod

Re: [Mod] Another Knockback Mod [knockback]

Posted: Wed May 29, 2019 16:06
by Joseph16
A few test players were harmed a couple hundred times during the making of this mod.....
Me and my brother tested this and I can confirm this to be true

Re: [Mod] Another Knockback Mod [knockback]

Posted: Wed May 29, 2019 16:43
by Joseph16
setting dir.y to 0 has no effect. Also, it is set to 0 by default when you get the mod.

Re: [Mod] Another Knockback Mod [knockback]

Posted: Wed May 29, 2019 18:48
by Lone_Wolf
Joseph13 wrote:setting dir.y to 0 has no effect. Also, it is set to 0 by default when you get the mod.
Replace lines 9 to 11 with dir.y = 0

https://github.com/LoneWolfHT/knockback ... nit.lua#L9

Re: [Mod] Another Knockback Mod [knockback]

Posted: Wed May 29, 2019 20:47
by Joseph16
Doesn't work.

Re: [Mod] Another Knockback Mod [knockback]

Posted: Wed May 29, 2019 21:34
by Lone_Wolf
Joseph13 wrote:Doesn't work.
Whoops, now change this line https://github.com/LoneWolfHT/knockback ... it.lua#L19
to pos.y = pos.y + 0.1

Re: [Mod] Another Knockback Mod [knockback]

Posted: Wed May 29, 2019 21:36
by Joseph16
Already tried that and it has barely any effect at all. If I set it to 0 it makes the player go under the ground by a block.

Re: [Mod] Another Knockback Mod [knockback]

Posted: Wed May 29, 2019 21:48
by Lone_Wolf
Joseph13 wrote:Already tried that and it has barely any effect at all. If I set it to 0 it makes the player go under the ground by a block.
It worked for me
Changing the y movement to 0 won't fix the jerkiness. The player is being teleported a small distance away from their attacker

Re: [Mod] Another Knockback Mod [knockback]

Posted: Wed May 29, 2019 22:48
by Joseph16
Yeah, I will just leave it as it is. Hopefully when the devs make knockback an official thing it will be less jerky.

Re: [Mod] Another Knockback Mod [knockback]

Posted: Thu May 30, 2019 13:02
by Joseph16
Would It be possible to get the velocity of the puncher and also use that for knockback? Like if the puncher is walking towards the player getting hit then it does a lot more knockback?

Re: [Mod] Another Knockback Mod [knockback]

Posted: Thu May 30, 2019 15:27
by Lone_Wolf
Joseph13 wrote:Would It be possible to get the velocity of the puncher and also use that for knockback? Like if the puncher is walking towards the player getting hit then it does a lot more knockback?
I don't think that would work too well. In PvP players are usually always moving. So I might as well just increase the knock back a little

Re: [Mod] Another Knockback Mod [knockback]

Posted: Thu May 30, 2019 15:28
by Joseph16
Ok

Re: [Mod] Another knockback mod [knockback]

Posted: Mon Feb 10, 2020 00:24
by Lone_Wolf
Minetest has knockback builtin now since 5.1 IIRC. So this mod is no longer useful for people with 5.1+
:thunderous_cheering: