How do I make a procedure where it makes an entity not able to deal damage for a certain amount of time?

Started by its_spree2 on

Topic category: Help with modding (Java Edition)

Last seen on 11:04, 5. Aug 2022
Joined Jul 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How do I make a procedure where it makes an entity not able to deal damage for a certain amount of time?

Hey I was wondering if there is a way to make a procedure where when my custom potion effect is applied that the certain player/entity is unable to deal any kind of damage for a certain period of time.

 

Any help would be appreciated.

Last seen on 17:04, 19. Dec 2022
Joined Nov 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
In the advanced section,…
Tue, 12/28/2021 - 21:14

In the advanced section, there is a block called "cancel event that triggered global trigger". then set the global trigger to "before entity is hurt" After that, type in "sub" in the search bar (next to procedure templates) and click on the first one you see. replace the event/target entity component from that procedure block with the source entity component (located in the Minecraft components section). that should do the trick.