Started by
jupop777
on
Topic category: Help with Minecraft modding (Java Edition)
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
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 :(
I am looking for a trigger of when entity A inflicts damage to entity B. The trigger should activate on entity A.
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.
Thank you, I will try this out. I must've missed it while I was browsing the global triggers.
I do have an inquiry about the wording- if the function was that the entity despawned, would the damage still go through?
The source entity is apparently missing dependencies, I cannot link this trigger to the entity.
Can you show me your procedure?
its a very simple "before entity attacks {trigger} despawn source entity {function}" and I am trying to nest it under entity tick update.
why try to nest under the entity tick update?
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.
But the subtype does not work for you? :(
Alrighty, I seem to have missed this when I saw the image. I will try this now, sorry.
The trigger I was looking for was added in 2021.1. Thank you for your time.