Does anyone know how could I make it so that an entity gives a potion effect to all the entities it attacks?

Started by Phoenix8772 on

Topic category: Help with modding (Java Edition)

Last seen on 15:22, 23. Sep 2023
Joined Jul 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Does anyone know how could I make it so that an entity gives a potion effect to all the entities it attacks?

Does anyone know how could I make it so that an entity gives a potion effect to all the entities it attacks?

Last seen on 00:09, 26. Jun 2024
Joined Jul 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I think you can make a…
Tue, 07/25/2023 - 12:40

I think you can make a procedure with a global trigger of "when entity attacked". And then check if the source entity is your custom entity, and if it match, give the potion effect to the target entity (the attacked entity)

Last seen on 00:09, 26. Jun 2024
Joined Jul 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
In this example procedure: -…
Tue, 07/25/2023 - 12:47

In this example procedure:

- We get it triggered as soon as an entity gets damaged in the world
- We check if the entity that griefed the damaged entity is a Bee
- If its a bee, then, we give a Fatigue Potion Effect to the damaged entity

Hope it helps ^^

Last seen on 15:22, 23. Sep 2023
Joined Jul 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
thank you very much
Tue, 07/25/2023 - 22:30

thank you very much