How can I check if the player hits something during a potion effect

Started by TheGlacielSentinel on

Topic category: Help with Minecraft modding (Java Edition)

Joined Nov 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How can I check if the player hits something during a potion effect
Sun, 11/03/2024 - 02:30 (edited)

So I am trying to make an effect for a mod, and I want it to strike everything I hit while it is active with lightning. How do I check if the target entity is being hit by the player?

This may be a stupid question

Edited by TheGlacielSentinel on Sun, 11/03/2024 - 02:30
Joined May 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Try something like the…
Sun, 11/03/2024 - 03:10

Try something like the following:

(This will also apply to projectiles... if a skeleton with the effect shoots you (or anything else), you will be struck. Don't know if that's your goal, but I'm sure it can be tweaked.)