[SOLVED] Activate a function when entity damages another

Started by jupop777 on

Topic category: Help with Minecraft modding (Java Edition)

Active 4 years ago
Joined Apr 2020
Points:
790

User statistics:

  • Modifications: 0
  • Forum topics: 19
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 132
[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
Active 2 years ago
Joined Feb 2019
Points:
752

User statistics:

  • Modifications: 0
  • Forum topics: 1
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 156
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 :(

Active 4 years ago
Joined Apr 2020
Points:
790

User statistics:

  • Modifications: 0
  • Forum topics: 19
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 132
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.

Active 2 years ago
Joined Feb 2019
Points:
752

User statistics:

  • Modifications: 0
  • Forum topics: 1
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 156
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.

Active 4 years ago
Joined Apr 2020
Points:
790

User statistics:

  • Modifications: 0
  • Forum topics: 19
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 132
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.

Active 4 years ago
Joined Apr 2020
Points:
790

User statistics:

  • Modifications: 0
  • Forum topics: 19
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 132
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?

Active 4 years ago
Joined Apr 2020
Points:
790

User statistics:

  • Modifications: 0
  • Forum topics: 19
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 132
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.

Active 2 years ago
Joined Feb 2019
Points:
752

User statistics:

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

Can you show me your procedure?

 
Active 4 years ago
Joined Apr 2020
Points:
790

User statistics:

  • Modifications: 0
  • Forum topics: 19
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 132
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.

Active 2 years ago
Joined Feb 2019
Points:
752

User statistics:

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

why try to nest under the entity tick update?

Active 4 years ago
Joined Apr 2020
Points:
790

User statistics:

  • Modifications: 0
  • Forum topics: 19
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 132
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.

Active 2 years ago
Joined Feb 2019
Points:
752

User statistics:

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

But the subtype does not work for you? :(

 
Active 4 years ago
Joined Apr 2020
Points:
790

User statistics:

  • Modifications: 0
  • Forum topics: 19
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 132
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.

Active 4 years ago
Joined Apr 2020
Points:
790

User statistics:

  • Modifications: 0
  • Forum topics: 19
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 132
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.