#858: Add LivingEntity#playHurtAnimation()

By: Collin <collinjbarber@gmail.com>
This commit is contained in:
Bukkit/Spigot 2023-07-04 06:55:10 +10:00
parent cc8a890979
commit cae67d1aad
2 changed files with 12 additions and 0 deletions

View File

@ -37,7 +37,10 @@ public enum EntityEffect {
RABBIT_JUMP(1, Rabbit.class), RABBIT_JUMP(1, Rabbit.class),
/** /**
* When mobs get hurt. * When mobs get hurt.
*
* @deprecated Use {@link LivingEntity#playHurtAnimation(float)}
*/ */
@Deprecated
HURT(2, LivingEntity.class), HURT(2, LivingEntity.class),
/** /**
* When a mob dies. * When a mob dies.

View File

@ -547,6 +547,15 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource
*/ */
public void swingOffHand(); public void swingOffHand();
/**
* Makes this entity flash red as if they were damaged.
*
* @param yaw The direction the damage is coming from in relation to the
* entity, where 0 is in front of the player, 90 is to the right, 180 is
* behind, and 270 is to the left
*/
public void playHurtAnimation(float yaw);
/** /**
* Set if this entity will be subject to collisions with other entities. * Set if this entity will be subject to collisions with other entities.
* <p> * <p>