How to make a player who hits an entity with a sword get a slowdown

Started by dezocrt0707 on

Topic category: Help with modding (Java Edition)

Last seen on 15:56, 13. Mar 2024
Joined Feb 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How to make a player who hits an entity with a sword get a slowdown

I know that I can make it so that when a player attacks an entity, effects are applied to it, but how can I make it so that I get a slowdown when I hit an entity with a sword?

Last seen on 11:02, 26. Apr 2024
Joined Feb 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Should be able to just make…
Fri, 03/01/2024 - 08:55

Should be able to just make it check if source entity has item in hand = to item (sword) or you can check if it’s part of a custom item tag which has all applicable items in it and if true apply slowness/any effect you need it to this can also be applied to other items of course.