NEED HELP making my enchantment occur once every time frame

Started by milkycashews on

Topic category: Help with Minecraft modding (Java Edition)

Joined Jun 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
NEED HELP making my enchantment occur once every time frame

I made an enchantment that gives a 10% chance to heal on every enemy hit while taking that same amount of health away from the enemy, the problem being that sweep attacks/sweeping edge make it so that i heal back full health against a lot of enemies. How can i make my enchantment only heal me once every second or two (or any time frame really) to avoid healing fully when attacking lots of enemies at once? Here's the enchant code: