Help with making every entity that attacks the player get an effect.

Started by varuniemcfruity on

Topic category: Help with MCreator software

Last seen on 18:32, 15. Apr 2023
Joined Apr 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Help with making every entity that attacks the player get an effect.

I'm working on a mod using MCreator, and I'm trying to implement a new feature where players can eat a special food item that grants them temporary protection against enemy attacks. Specifically, I want to apply the wither effect to any entity that attacks the player for 2400 ticks after they consume the food item.

To achieve this, I've already created a procedure in MCreator and set it to trigger after the player eats the food item. However, I'm not sure how to proceed from there. Can someone please help me figure out how to apply the wither effect to attacking entities for the specified duration? Any guidance or advice would be greatly appreciated!