how do i make reversed knockback enchant

Started by Emperor_GG on

Topic category: Help with modding (Java Edition)

Last seen on 10:21, 7. Oct 2023
Joined Aug 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
how do i make reversed knockback enchant

 a simple enchant that is the reverse of knockback (like pulls entities closer rather than pushing them away)

also this will be for a custom smp (if this is helpful)

Last seen on 06:22, 13. Mar 2023
Joined Feb 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
You could do this by…
Sat, 09/03/2022 - 03:31

You could do this by overriding the entity vectors to be towards the player plus whatever they are. It takes some math with sins and cosines to do this in the right directions however.