You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, the DAMAGE event only triggers after an entity takes damage; however, we sometimes want some action to occur when an attack attempt is made, regardless of whether it goes through or not (most notably, when you know that the attack will be cancelled out by some damage invulnerability). The ATTACKED event would be identical to the DAMAGE event, with the sole exception of it firing at the start of player damage handling, instead of at the end.
Note: I use ATTACKED since Forge has a LivingAttackEvent for this same purpose (fired before LivingDamageEvent, which is equivalent to figura's DAMAGE event), but PRE_DAMAGE is also a valid name for this event, and would fit the Figura event naming schema better
The text was updated successfully, but these errors were encountered:
couldnt you just do this by going through everyone around you and checking if theyre both swinging their arm and have you as their targeted entity?
There are several issues with this:
This would give false positives if the player is swinging their arm for some other action and just happen to be looking at you
This would be an inefficient solution and cause excessive overhead for something that could be easily replaced with an event
That only works if it's a player that's attacking you, this wouldn't give you information about arrows, void, fire, or other sources of damage that an ATTACKED/PRE_DAMAGE event would give you
After further investigation, I now see why this wasn't implemented originally: You can only get this information on the server side (which as a client-side-only mod, Figura didn't want to implement). I will leave the issue open in case anyone later figures out a way to make this work.
Request Description
Currently, the
DAMAGE
event only triggers after an entity takes damage; however, we sometimes want some action to occur when an attack attempt is made, regardless of whether it goes through or not (most notably, when you know that the attack will be cancelled out by some damage invulnerability). TheATTACKED
event would be identical to theDAMAGE
event, with the sole exception of it firing at the start of player damage handling, instead of at the end.Note: I use
ATTACKED
since Forge has aLivingAttackEvent
for this same purpose (fired beforeLivingDamageEvent
, which is equivalent to figura'sDAMAGE
event), butPRE_DAMAGE
is also a valid name for this event, and would fit the Figura event naming schema betterThe text was updated successfully, but these errors were encountered: