Jump to content

LivingDeathEvent client side 1.15.2


Nitoxym

Recommended Posts

10 minutes ago, Nitoxym said:

Any way to detect that animation?

Not easily, there's no event being fired. The way it works is that the health of the entity is synced to the client using EntityDataManager and the client starts doing the death animation if the health is <= 0.

 

14 minutes ago, Nitoxym said:

Or the fact that the entity is removed?

No events are fired for entities being removed from worlds.

 

17 minutes ago, Nitoxym said:

Also, any way to know if this is player who killed it?

Not on the client. There is no information sent to the client about damage sources. It is only told "this entity took X damage" and "the entity health is now Y".

Link to comment
Share on other sites

3 minutes ago, diesieben07 said:

Not easily, there's no event being fired. The way it works is that the health of the entity is synced to the client using EntityDataManager and the client starts doing the death animation if the health is <= 0.

Ok thanks, but how can I be sure that the player killed the entity? I saw this mod, and they managed to do it, but I can't figure how: https://github.com/symt/zealot-counter/tree/1.2.2/src/main/java/io/github/symt

What I know is that it only detects when the player one shot the mob

Edited by Nitoxym
Link to comment
Share on other sites

They check that the entity dying either was the entity you last attacked or the entity you are looking at.

Both is often true, but not reliable. If you are looking at an entity someone else could still kill it - their method would attribute that kill to the player, just because they are looking at the entity.

Link to comment
Share on other sites

1 minute ago, diesieben07 said:

They check that the entity dying either was the entity you last attacked or the entity you are looking at.

How can I do that?

5 minutes ago, Nitoxym said:

EntityDataManager

Also, where do I use that? And how?

Link to comment
Share on other sites

Just now, diesieben07 said:

Did you even look at the code you linked to?

My bad, I checked after

Just now, diesieben07 said:

Well, what do you want to achieve?

I want to detect when the entity is dying, then I'll manage to detect "if the entity is killed by the player"

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.