[SOLVED] Activate a function when entity damages another

Started by jupop777 on

Topic category: Help with modding (Java Edition)

Last seen on 19:13, 24. May 2021
Joined Apr 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
[SOLVED] Activate a function when entity damages another
Thu, 05/13/2021 - 18:29 (edited)

Im trying to create entity based projectiles to my mod, but there docent seem to be a trigger for when it damages an entity. I'd like to kill the entity when it damages another, kinda like a projectile. Any help would be useful, TIA

Edited by jupop777 on Thu, 05/13/2021 - 18:29
Last seen on 00:59, 19. Oct 2022
Joined Feb 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
1.- is the "projectile" from…
Tue, 05/04/2021 - 19:25

1.- is the "projectile" from a ranged item? or is it an entity that is launched as a projectile?
2.- if there is a tigger when an entity damages another one?

I don't understand very well :(

Last seen on 19:13, 24. May 2021
Joined Apr 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I am looking for a trigger…
Tue, 05/04/2021 - 23:57

I am looking for a trigger of when entity A inflicts damage to entity B. The trigger should activate on entity A.

Last seen on 00:59, 19. Oct 2022
Joined Feb 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
There is a global tigger …
Wed, 05/05/2021 - 00:54

There is a global tigger "before entity is hurt".
https://imgur.com/a/C1MhOgA
"source entity" is for the one who hits
"event entity" is for the one who is hit.
You can also use "subtype" to check who is the hitter or who is hit.

You can use "tem hand source entity" to get the object being hit.

Last seen on 19:13, 24. May 2021
Joined Apr 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Thank you, I will try this…
Wed, 05/05/2021 - 01:00

Thank you, I will try this out. I must've missed it while I was browsing the global triggers.

Last seen on 19:13, 24. May 2021
Joined Apr 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I do have an inquiry about…
Wed, 05/05/2021 - 01:10

I do have an inquiry about the wording- if the function was that the entity despawned, would the damage still go through?

Last seen on 19:13, 24. May 2021
Joined Apr 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
The source entity is…
Wed, 05/05/2021 - 19:22

The source entity is apparently missing dependencies, I cannot link this trigger to the entity.

Last seen on 00:59, 19. Oct 2022
Joined Feb 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Can you show me your…
Wed, 05/05/2021 - 19:30

Can you show me your procedure?

 
Last seen on 19:13, 24. May 2021
Joined Apr 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
its a very simple "before…
Wed, 05/05/2021 - 20:06

its a very simple "before entity attacks {trigger} despawn source entity {function}" and I am trying to nest it under entity tick update.

Last seen on 00:59, 19. Oct 2022
Joined Feb 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
why try to nest under the…
Wed, 05/05/2021 - 20:39

why try to nest under the entity tick update?

Last seen on 19:13, 24. May 2021
Joined Apr 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Because I wish this instance…
Mon, 05/10/2021 - 19:17

Because I wish this instance to be linked to a certain entity and entity tick update seems to be the only way to efficiently do this.

Last seen on 00:59, 19. Oct 2022
Joined Feb 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
But the subtype does not…
Tue, 05/11/2021 - 02:25

But the subtype does not work for you? :(

 
Last seen on 19:13, 24. May 2021
Joined Apr 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Alrighty, I seem to have…
Thu, 05/13/2021 - 17:06

Alrighty, I seem to have missed this when I saw the image. I will try this now, sorry.

Last seen on 19:13, 24. May 2021
Joined Apr 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
The trigger I was looking…
Thu, 05/13/2021 - 18:29

The trigger I was looking for was added in 2021.1. Thank you for your time.