Topic category: Help with Minecraft modding (Java Edition)
Alright, so, I saw a lot of player who had difficulty to add " negative knockback ".
As you know and you have probably tried it, if you try to put a negative knockback value like -1 the hit entity will not move.
So you simply have to try to define a new location of the entity to that of the one who hit it, of which I give you an example of my mod, a sword that hits an entity does damage, but if this entity is a creeper, then the creeper will be attracted to the player and explode.
We have defined the new "location" of the entity as being X of the player, Y of the player and Z of the player
LINK FOR THE VISUAL HELP : https://imgur.com/a/ajSiTV4
You're welcome :)
(Don't forgot to set this discussion to favorite for an easy comeback)
Why teleport? Shouldn't it use velocity to feel more normal.
Really, teleport is better and he will not take any " fall damage " with this