Tutorial for negative knockback

Started by Themilkman on

Topic category: Help with Minecraft modding (Java Edition)

Joined Dec 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Tutorial for negative knockback
Mon, 05/08/2023 - 15:27 (edited)

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)

Edited by Themilkman on Mon, 05/08/2023 - 15:27
Joined Dec 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Why teleport? Shouldn't it…
Tue, 05/09/2023 - 10:03

Why teleport? Shouldn't it use velocity to feel more normal.

Joined Dec 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Really, teleport is better…
Tue, 05/09/2023 - 16:32

Really, teleport is better and he will not take any " fall damage " with this