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 Minecraft modding (Java Edition)

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?

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)

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 ^^

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