Jump to content

Preventing damage effects altogether


Alekseyev

Recommended Posts

Hi, I can successfully use LivingHurtEvent or LivingDamageEvent to set damage caused by a certain source to zero or cancel the event right away. However, other effects associated with damage still play, notably the hurt sound and the screenshake. How would I go about removing these depending on the damage source, say, for example, drowning or being on fire?

Link to comment
Share on other sites

LivingAttackEvent allows you to cancel the damage alltogether, with the effects.

If you want to only cancel the effects then it's more tricky. You would need to use a tick handler and basically do the reverse of what the EntityLivingBase#attackEntityFrom does to the entity that took damage that you caught in this event.

Edited by V0idWa1k3r
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
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
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.

Announcements



×
×
  • Create New...

Important Information

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